A standoff with a former Army Ranger in Shapleigh ends.

Twitter / Doug Saunders

The York County Sheriff's Department says a standoff with a former Army Ranger who was firing a gun randomly at his family's southern Maine farm ended peacefully.

The 26-year-old man was described by a family member as "out of control" and armed with a semi-automatic assault rifle Sunday.

Sheriff William King Jr. identified the gunman as 26-year-old Robert W. Ferrera of Shapleigh. Deputies say he emerged from his home with a gun and binoculars several times, but that he was unarmed when he was taken into custody outside the home. He was charged with reckless conduct with a dangerous weapon and a parole violation.

The Rangers are an elite regiment of the Army, and Ferrera had several guns. King said Ferrera was upset with his living arrangements.