A survivalist accused of ambushing two state troopers, killing one and seriously wounding the other, was captured by US marshals near an abandoned aeroplane hangar.
Prosecutors will seek the death penalty for Eric Frein, who meekly gave himself up when surrounded, ending a seven-week manhunt in Pennsylvania that had rattled the nerves of area residents.
"He did not just give up because he was tired," state police commissioner Frank Noonan said. "He gave up because he was caught."
State police said they did not know whether Frein, who was unarmed when captured, had been using the hangar as a shelter during his 48 days on the run, and they would not say what they found there.
Frein was held in the handcuffs of the trooper he is accused of killing, Governor Tom Corbett said.
The quiet capture of Frein, who kneeled and put his hands up when marshals approached him, ended weeks of tension and turmoil in the area, as authorities at times closed schools, cancelled outdoor events and blockaded roads to pursue him.
Residents grew weary of hearing helicopters overhead, while small businesses suffered mounting losses and town supervisors cancelled a popular Halloween parade.
Frein is charged with opening fire outside the Blooming Grove barracks on September 12, killing Corporal Bryon Dickson and seriously wounding Trooper Alex Douglass.
After his arrest near the abandoned hangar, he was placed in Cpl Dickson's car for the ride back to the barracks, about 30 miles away.
Tpr Douglass and his family and Cpl Dickson's family expressed "relief and gratitude" over Frein's arrest, Mr Noonan said.
Police said they linked Frein to the ambush after a man walking his dog discovered his partly submerged car three days later in a swamp a few miles from the shooting scene.
Inside, investigators found shell casings matching those found at the barracks as well as Frein's driver's licence, camouflage face paint, two empty rifle cases and military gear.
Officials, saying Frein was armed and extremely dangerous, had urged residents to be alert and cautious.
Using dogs, thermal imaging technology and other tools, law enforcement officials combed miles of forest as they hunted for Frein, whom they called an experienced survivalist at home in the woods.
They pursued countless tips and closed in on an area around Frein's parents' home in Canadensis after he used his mobile phone to try contacting them and the signal was traced to a location about three miles away.
At times police ordered nearby residents to stay inside or prevented them from returning home.
Trackers found items they believe Frein hid or abandoned in the woods - including soiled nappies, empty packs of Serbian cigarettes, an AK-47-style assault rifle and ammunition and two pipe bombs that were functional and capable of causing significant damage.
They also discovered a journal, allegedly kept by Frein and found in a bag of rubbish at a hastily abandoned campsite, that offered a chilling account of the ambush and his subsequent escape into the woods.
The journal's author described Cpl Dickson as falling "still and quiet" after being shot twice.
Police spotted a man they believed to be Frein at several points during the manhunt, but it was always from a distance, with the rugged terrain allowing him to keep them at bay.
Police said he appeared to be treating the manhunt as a game.
Frein, 31, had expressed anti-law enforcement views online and to people who knew him.
His criminal record appeared limited to a decade-old case involving items stolen from a Second World War re-enactors event in New York state, for which he spent 109 days in jail.
Police found a US Army manual called Sniper Training And Employment in his bedroom at his parents' house, and his father, a retired Army major, told authorities that his son is an excellent marksman who "doesn't miss," according to a police affidavit.
The authorities believe Frein had been planning a confrontation with police for years, citing information they found on a computer used by him.
His 18-year-old sister, Tiffany Frein, earlier acknowledged that he "did something messed up" but told NBC News that he is "not a psycho".
Frein is charged with first-degree murder and various other offences, including two counts of possession of weapons of mass destruction filed after police discovered the pipe bombs.
Cpl Dickson, at his funeral, was called a devoted husband and father and "impeccable" ex-Marine who took his work seriously but also enjoyed making wooden toys for his young sons and finding humour in everyday situations.
Tpr Douglass was shot in the pelvis and critically injured in the ambush, which took place during a late-night shift change.
He remained in hospital until October 16, when he was discharged to a rehabilitation facility.
"If you attack troopers, and a civilised society, the Pennsylvania State Police will bring you to justice. Eric Frein is a coward," the Pennsylvania State Troopers Association said.
"Cpl Bryon K Dickson II and Trooper Alex T Douglass are true heroes."