A man who was under the supervision of Maryland mental health officials was charged Wednesday night with killing two people in Olney, shootings that terrified the normally tranquil community, authorities said.

Rohan J. Goodlett, 35, was charged with two counts of murder in the deaths of a man walking home from his job at a sandwich shop Monday night and another man found slain inside his home Friday.

Goodlett has been arrested several times since 2004, according to court records. But charges filed in 2008 placed him under state supervision, and he still was under the watch of the state Department of Health and Mental Hygiene at the time of the killings, court records and Montgomery County State’s Attorney John McCarthy said.

In January 2009, Goodlett was found not criminally responsible because of mental illness in a case involving burglary and harassment allegations. He was released that day after mental health professionals had declared that he was not a danger to himself or others under special conditions, McCarthy and court records said.

He was placed under state care and was required to meet 17 conditions for his continued release, the court records say. Among them: He had to continue mental health treatment; he could not own or possess any guns; he had to abstain from alcohol and drugs; and he could not break the law, according to court papers.

It is unknown how the state has been monitoring Goodlett to ensure that he was meeting those conditions. McCarthy said he did not know. David Paulson, a spokesman for the state agency that was responsible for supervising Goodlett, said “the situation is under review” and declined to comment further.

Goodlett is charged in the death of Punyasara W. Palkumbure Gedara, 41, as he walked home from the Subway shop, police said. Several days earlier, police say, Goodlett killed his 81-year-old neighbor, Nazir Ahmed, who was found dead in the second-floor bedroom of his home in the 19500 block of Olney Mill Road. Goodlett lives in the same block.

Homicides are rare in Olney – a bedroom community about 10 miles north of the Capital Beltway — and that led police to search for a connection between the two shootings.

Montgomery County Police Chief J. Thomas Manger said ballistics tests indicated that the same gun was used in both killings. He said a bullet matching the others was found in Goodlett’s apartment.

It was unclear how Goodlett would have gotten the gun allegedly used in the slayings. Police have not recovered the gun, so it has not yet been traced to its original purchase.

Goodlett was picked up Monday night in the hours after the second slaying, Manger said. Police had issued a lookout for a tan Toyota Camry seen in the area where Gedara was shot. Officers spotted the car, pulled it over and found marijuana inside, the chief and court papers said. Goodlett was arrested on drug charges, and he has been in custody since then.

He is expected to make a court appearance Thursday.

According to his Facebook page, Goodlett was in Montgomery’s Sherwood High School in 1993 and also studied at Howard University, where he played soccer. He describes his political views as “middle of the road” and lists his religious views as “Christianity.” He says his interests are cutting hair and weight training.

Documents reveal some of Goodlett’s previous troubles.

On March 12, 2008, he knocked on the door of a Brookeville woman, who after opening it recognized Goodlett and tried to shut the door, according to arrest records filed in court. Goodlett stuck his foot in the door, and the woman yelled for her father, according to the records.

Goodlett’s foot was eventually forced outside and the door was shut as he yelled to the woman that he just wanted to be her friend, according to the records. He then went around to the back of the house and began looking through windows. After returning to the front, he yelled, “Just let me in! . . . Your dad is getting in the way of our friendship!” according to the records.

After his arrest, he was held without bond at Springfield Hospital Center. On Jan. 15, 2009, Goodlett was found “not criminally responsible” of fourth-degree burglary and harassment, according to court papers. He was released and was said to be “not dangerous due to mental disorder” by state mental health officials.

Montgomery County Circuit Court Judge Ann S. Harrington ordered him released provided he met the conditions outlined by state officials. Goodlett was subject to those conditions for five years, according to the judge’s order.

Among the terms: Stay away from four women he was accused of harassing.

At least one of those victims earlier submitted to the judge a statement of how the incident affected her, according to court records.

“I believe that Rohan Goodlett has no regard for the law and he has shown that he is not fearful of the police,” she wrote. “Although he is currently taking medications for his mental illness, I am frightened of what may occur if he were to not comply with his medication regimen again.”

Friends and relatives of Gedara, who had gathered at an uncle’s house late Wednesday, were angered that Goodlett was not being watched carefully enough.

“They should have a better system to find out about those problems,” said Saman Adikari, a friend of Gedara’s.

“They shouldn’t have released him.”