The quiet of Sunday morning was torn apart for one Montgomery County neighborhood when, police say, a man fired a stolen shotgun at police officers while trying to force his way into people’s homes and sheds.

Randy Root, 35, was arraigned Monday afternoon and charged with attempted first-degree murder, aggravated assault, assault of a law enforcement officer, and related offenses, court records show. He remained in custody at the county prison with bail set at $1 million.

Officers from Upper Gwynedd encountered Root, of Warrington, about 1 p.m. while responding to a call about a suspicious man roaming around the township.

A homeowner told police he first saw Root walking down his driveway, and that Root had asked him for water, according to the affidavit of probable cause for Root’s arrest. The man was worried that Root was trying to case his home for a potential burglary. Another nearby resident told police he had chased Root off his property after he had found him rifling through his shed.

Officers later found Root near Sanctuary United Methodist Church, police said, and he ran, crossing a nearby field.

After a short search, Sgt. Ray Royds, a 21-year veteran of the department, and two other officers found Root in a backyard on Cathys Lane. When Royds again tried to talk to him, Root said he was going to kill him and called him the N-word, according to the affidavit.

He then fired a shotgun at Royds from about 30 feet away, authorities say. The gunfire missed the officer, and Root was taken into custody in the backyard of a home across the street from the shooting scene.

Investigators recovered the shotgun he had used, as well as a rifle. Root wasn’t legally able to possess weapons due to a felony burglary conviction from 2009, according to court records.

In that case, Root broke into a home in Warminster in search of cash and jewels, the Hatboro Public Spirit and Willow Grove Guide reported at the time.

In Upper Gwynedd, detectives discovered that Root had stolen those guns from a home next door to where he fired at the officers, the affidavit said. The guns’ owner said he had last seen the firearms Sunday morning and had left them in a room near his back door.