Suspect: A manhunt had been launched to find Captain Leonard Egland who is thought to have killed his ex-wife and her boyfriend

Police say an Army captain being sought in the deaths of four people in Pennsylvania and Virginia has been found dead of an apparently self-inflicted gunshot wound.

Pennsylvania State Police spokesman David Lynch says the body of 37-year-old Leonard John Egland of Fort Lee, Virginia, was found shortly after 3.30pm Sunday in Warwick Township.

Egland, who recently returned from war service and fired at officers in suburban Philadelphia, was wanted in connection with the Virginia deaths of his ex-wife, her boyfriend and the boyfriend's young son, authorities said.

The soldier's former mother-in-law was also killed.

District Attorney David Heckler didn't know when the Virginia deaths occurred, but said Egland's former mother-in-law, 66-year-old Barbara Reuhl of Buckingham, Pennsylvania, was believed to have been killed Saturday night.

Later that night, Egland went to St. Luke's Hospital in Quakertown, where he tried to leave his young daughter along with a note, Mr Heckler said.

Fears that the combat veteran was on a mission to wipe out his ex-wife's family led to police guards being placed on relatives homes.

Police in Church School Road in the Buckingham Township where Egland's mother-in-law is believed to have lived

After a male nurse or orderly confronted him, he allegedly flashed a pistol, and the hospital worker called police with a description of the suspect and his vehicle.

Just before midnight, the vehicle was stopped by state and local police in Doylestown Township, where he fired shots from a semi-automatic rifle, hitting a Doylestown officer in the arm and shattering a windshield that sent glass into the face of an officer.

The vehicle was later spotted Sunday in Warwick Township, the Associated Press reports.

Egland's mother-in-law Barbara Ruehl, 66, was shot dead before she could get out of her chair in Buckingham Township, Pennsylvania, pictured

Local officers reported being fired upon again, but no one was hit.

Police issued an alert to residents to consider the suspect armed and dangerous.

Mr Heckler said the suspect apparently tried unsuccessfully to break into a home, but was still being sought Sunday by police and a SWAT team.

He was believed to be on foot.

Egland had recently returned from the latest of three deployments to Iraq and Afghanistan, Mr Heckler said.