An off-duty Warminster Township police officer shot and killed a man who broke into the officer's Andorra house early Monday, police said.

A second burglar fled from the house, but was apprehended later Monday after driving off in the officer's car.

Philadelphia police said the incident appeared to be random, but the investigation is ongoing. The officer shares the home with his wife and four children. No one was injured, police said.

Police said Edward Mehlberger, 39, and Tim Zgrzepski, 29, broke in through a ground-story window in the officer's Sagamore Road home around 4 a.m. Monday. The officer, who has not been identified, heard noises and discovered Mehlberger in a bedroom. After telling him to put his hands up, to no avail, the officer opened fire, hitting Mehlberger multiple times.

Mehlberger, of the 3100 block of Custer Street in Kensington, was later pronounced dead at the scene.

Zgrzepski, of the 2600 block of Kensington Avenue, ran from the house and stole the officer's minivan, police said. The car was abandoned a few blocks later, and Zgrzepski was arrested soon afterward.

The officer has been with Warminster police for more than 10 years, police said.

Contact Allison Steele at 215-854-2641 or asteele@phillynews.com.