CANAAN, Maine — A 17-year-old boy was arrested Friday night after he fired three shots into a home on Mud Run Road, according to Somerset County Sheriff Dale Lancaster.

The teenager, whose name was not immediately released because of his age, initially was charged with reckless conduct with a dangerous weapon, criminal threatening with a dangerous weapon, refusing to submit to arrest and assault, Lancaster said Monday in a news release.

The reckless conduct and criminal threatening charges are Class C felonies punishable by up to five years in prison and fines of up to $5,000.

After his arrest, the juvenile was taken to Mountain View Correctional Center. He was scheduled to make his initial court appearance on Monday.

According to Lancaster, the sheriff’s office was called to the Mud Run Road residence at about 7:30 p.m. Friday. The homeowner reported that three juveniles were outside firing a weapon toward the house.

When Cpl. Richie Putnam and Deputies Toby Blodgett and Dan Arminger arrived, they learned that the juveniles had fled.

Lancaster said an investigation indicated that the three teen boys had been visiting at the home a few hours before the shots were fired. The teen who later was arrested allegedly had brought alcohol and three handguns along.

The homeowner and her boyfriend were not initially present, but when they returned home, the boyfriend reportedly confronted the three juveniles. The 17-year-old and one juvenile companion then left the residence, Lancaster said.

But the 17-year-old was extremely agitated with the property owner’s boyfriend, and once outside, made threats against him, the sheriff said. The teen ultimately fired three shots from a .22-caliber handgun at the house — one through the kitchen window, one through the living room window and one more through an upstairs bedroom wall, Lancaster said.

While the shots were being fired, the homeowner hid on the floor of her home with her children, ranging from 2 to 16 years old, Lancaster said.

Deputies later located the 17-year-old at a home on Hill Road in Canaan.

When deputies confronted him, the teen suspect allegedly became aggressive. Deputies, however, were able to restrain the teen and took him into custody, Lancaster said.

The sheriff’s office is working with the Somerset County district attorney’s office as the investigation continues. The sheriff’s office was assisted by the Maine State Police, the Pittsfield Police Department, the Clinton Police Department and a juvenile corrections officer.

“We are fortunate that no one was injured at the home, and that this dangerous situation was resolved without anyone being harmed,” Lancaster said.