Pennsylvania State Police, ending a seven-week manhunt, have captured a man accused of ambushing two troopers, leaving one dead and seriously injuring the other.

Eric Frein, 31, was taken into custody Thursday, state police said. They released no details of his capture.

Frein is charged with opening fire outside the Blooming Grove barracks on Sept. 12, killing Cpl. Bryon Dickson and seriously wounding another trooper.

Police said they linked him to the ambush after a man walking his dog discovered his partly submerged SUV three days later in a swamp a few miles from the shooting scene. Inside, investigators found shell casings matching those found at barracks as well as Frein's driver's license, camouflage face paint, two empty rifle cases and military gear.

Saying Frein was armed and extremely dangerous, officials had closed schools and 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 cellphone to try contacting them, and the signal was traced to a location about 3 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 diapers, 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 trash 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 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 allegedly held anti-law enforcement views for many years and expressed them both online and to people who knew him. But the source of his alleged vendetta remains unclear. His criminal record appears limited to a decade-old misdemeanor case involving items stolen from a World War II re-enactors event in upstate New York, for which he spent 109 days in jail.

Police found a U.S. Army manual called "Sniper Training and Employment" in the suspect's 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. Authorities believe he had been planning a confrontation with police for years, citing information they found on a computer used by Frein.

Frein belonged to a military re-enactor's group, playing the part of a Serbian solder. He had a small role in a 2007 movie about a concentration camp survivor and helped with props and historical references on a documentary about World War I.

The FBI named him to its 10 most wanted list.

His 18-year-old sister, Tiffany Frein, earlier acknowledged that her brother "did something messed up" but told NBC News that he is "not a psycho."

Frein is charged with first-degree murder and various other offenses, including two counts of possession of weapons of mass destruction filed after police discovered the pipe bombs.

At his funeral, Dickson 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 humor in everyday situations. Trooper Alex Douglass was shot in the pelvis and critically injured in the ambush, which took place during a late-night shift change.

Douglass remained hospitalized until Oct. 16, when he was discharged to a rehabilitation facility.