BRIDGEPORT - A Newtown man, charged with exposing himself to teenaged girls on Fairfield’s Jennings Beach has been granted a pretrial probation program.

Following a hearing on Tuesday, Superior Court Judge William Holden granted the supervised diversionary program to 62-year-old William Connelly.

Under the program Connelly will undergo psychiatric treatment. If he commits no other crimes during the next two years the original charges against him will be dismissed.

The judge also ordered Connolly to have no further contact with the victims and to stay away from Jennings Beach.

“He is under onerous psychiatric conditions for the next 24 months,” Connelly’s lawyer, Edward Gavin, said later. “Mr. Connolly was fully evaluated, the prosecutor acted reasonably and the judge made the right decision.”

Senior Assistant State’s Attorney Tatiana Messina did not object to Connelly getting the program.

Messina told the judge that she is concerned that Connelly was charged with public indecency in 1993 after he was caught peeking into windows in New Canaan but she continued that the victims in the Fairfield case wanted to leave the disposition of the case to the discretion of the judge.

Connelly, of Underhill Road in Newtown, was charged with risk of injury to children, public indecency and second-degree breach of peace.

On Sept. 4, 2017, police said two teenaged girls were sunning on Jennings Beach when they looked up and saw a man sitting in a beach chair exposing himself to them about 14 feet away. The girls took a photograph of the man who was holding a book entitled, “Never a Dull Moment,” upside down, police said.

Police said they later received another complaint from a local woman about a man exposing himself at the beach. This time the woman took a video of the man, police said.

Police distributed a photograph of the man taken in the first incident to area news media in an effort to identify the alleged flasher. They said they subsequently received numerous calls, many complaining of the man exposing himself but a few identifying the man in the photograph as Connelly.