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.
Police were able to locate Robinson, of Pittsburgh, because he was on parole and wearing an electronic ankle bracelet, Moffatt said. He has an arrest record for drug and firearms charges and was paroled after in August 2007 after serving time for carrying an unlicensed firearm.
Robinson 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.
Morton has a criminal record dating to 1991, including two prison terms for burglary, records show.
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.
Crawshaw's uncle William Crawshaw said his nephew was easygoing but wanted more excitement than the university job offered.
"He was interested in a little more -- I don't like to use the word action -- but that's about all, I guess," he 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.