PENN HILLS, Pa. — A suburban Pittsburgh police officer awaiting backup was fatally shot in his parked patrol car by a man who emerged from a home moments after killing someone over a $500 drug debt, police said.

Penn Hills police Officer Michael Crawshaw, 32, was the first to respond to a 911 call made around 8:20 p.m. Sunday. Crawshaw was advised to wait in his patrol car because of past problems reported at the home and because dispatchers heard shots over the phone, Penn Hills Chief Howard Burton said.

Ronald Robinson, 31, walked out of the home and opened fire as he approached Crawshaw’s car, Allegheny County Police Superintendent Charles Moffatt said Monday. Robinson used “some kind of assault rifle” – possibly an AK-47 – judging by shell casings found at the scene, Moffatt said.

“The gunman exits, sees the officer there, so he takes it upon himself to open fire upon the officer as he sits inside his car,” Moffatt said.

The officer’s weapon was removed from his holster, showing that he might have been able to draw his .45-caliber Glock pistol and fire a shot, Moffatt said. Police were still investigating.

Robinson fired at least nine shots at the officer, Moffatt said. Three or four hit Crawshaw, including a single fatal shot to the head, said Dr. Karl Williams, county medical examiner. An autopsy is planned.

Robinson, of Pittsburgh, was charged with burglary and two counts of homicide after he went to police for questioning about 4 a.m. Monday, Moffatt said. It was not clear whether he had an attorney, and court documents were not available because Robinson hadn’t been arraigned.

Crawshaw was taken to UPMC Presbyterian Hospital, where he was pronounced dead shortly before 9 p.m.

The other victim, Danyal Morton, 40, who lived at the house, had been the one to call 911 and was found dead in a second-floor bathroom, Moffatt said.

Morton owed Robinson $500 for either cocaine or heroin from a drug deal Saturday, Moffatt said. Both shootings occurred within four minutes, judging by 911 records and police logs.

The slain officer apparently heard gunfire as he sat in his car awaiting backup officers and was shot moments later, Moffatt said.

“He didn’t go rushing in by himself; he wasn’t (trying to be) a hero,” Burton said.

Another man who sometimes lived in the home was also present during the shooting, but police could not explain why he was not shot, Moffatt said. He made a second call to 911, police said.

Neighbors reported hearing about 10 gunshots at the home in Penn Hills, a middle-class community about 10 miles east of Pittsburgh.

No crime scene tape was visible outside the two-story brick home, and no one answered the door or the phone. Schoolchildren walked to bus stops in the neighborhood.

Robert Cephas, 57, who lives next door, said that he wasn’t home at the time, but that his wife and grandkids were.

“They were hitting the floor, my grandkids did,” he said.

Crawshaw was a three-year member of the force and had worked at the University of Pittsburgh police department, Burton said.

“Officer Crawshaw was a fine officer, and Penn Hills was lucky to have him patrolling our community,” Mayor Anthony DeLuca Jr. said.

Gov. Ed Rendell ordered state flags to fly at half staff in honor of Crawshaw, whose brother, Matthew Crawshaw, is also a police officer in suburban Pittsburgh.

The slain officer is the fourth to be killed on duty in Allegheny County this year. Pittsburgh officers Eric Kelly, Stephen Mayhle and Paul Sciullo were fatally shot in a gun battle while responding to a call at a home in April.

The last time a Penn Hills officer was killed in the line of duty was March 25, 1972, when Sgt. William Schrott and Officer Bartley Connolly Jr. were shot while trying to catch an armed robber at a shopping center.