Police are trying to find out whether the shooting deaths of two friends hours apart in northwest Philadelphia — one of them while he was talking to an aide for a state House candidate — are related to a conflict between two groups.

Homicide Capt. James Clark said 21-year-old Alex Cherry was shot Sunday afternoon as he was standing outside a West Oak Lane store with several other young men and talking to an employee of candidate Chris Rabb.

The candidate had been talking to Cherry earlier but officials said he had stepped away before the shooting.

The shooter "came around the corner, fired one time, striking him (Cherry) in back of the head, and then stood over (the) top of him and fired several more times," Clark said.

"He had his whole life in front of him," Rabb said later that night, adding that Cherry was looking forward to working at his local polling place on Tuesday.

Four hours after the shooting and a couple of blocks away, 18-year-old Elijah Frazier was gunned down by someone who got out of a red sport utility vehicle and began firing into a crowd, police said. Frazier was hit in the back and ran to a Chinese takeout restaurant. Emergency crews found him there and rushed him to a hospital, where he died. A 17-year-old also wounded was hospitalized in stable condition.

Clark said the only firm connection between the slayings so far is that the two victims were friends and lived in the area. But both were also members of a group of young men that had an ongoing dispute with a group from another area, Clark said. He said there was video of the first slaying but not so far of the second.

Rabb, a Democrat running for the 200th House district representing the Mount Airy, Chestnut Hill and Oak Lane neighborhoods, offered his condolences to the families of victims of violence. In a statement late Sunday night, he said that when he spoke to Cherry, he was impressed by his enthusiasm for the political process.

"This impressed us and we were in the process of encouraging him to join our campaign," Rabb said. "Moments after he gave us his contact information, he was murdered."