Two Prince William County men helped peacefully capture an armed fugitive who crept into their home through an unlocked door and hid in the basement Thursday, police said.

The men encountered the fugitive, Earl Patrick Mitchell, 20, in their home and spent several hours trying to calm him as police swarmed the area, Prince William County police said. Around 8 p.m., at a moment when Mitchell was distracted, the men fled their home and notified police, who took Mitchell into custody.

The manhunt started about 1:30 p.m. Thursday when a Manassas police officer ran the license plate number of a car he spotted near Dumfries Road and Winterset Drive. The car, which had Pennsylvania plates, was connected to a homicide investigation in Pennsylvania, police said. The officer attempted to stop the vehicle, police said, but the driver pulled away, eventually losing control and running onto a sidewalk.

Police said Mitchell, who they identified as the driver, fled on foot into a nearby Lake Jackson neighborhood. A passenger remained at the scene and was detained, they said.

Mitchell, of Philadelphia, is a suspected in a homicide in Johnstown, Pa., police said. He was charged by Prince William County Police with crimes including possession of a stolen firearm, abduction, and fleeing from justice. He was held without bail.