Two men have been charged in an ambush at a backyard cookout near Pittsburgh that killed a pregnant woman, her 8-month-old fetus and four other adults.

Allegheny County District Attorney Stephen Zappala Jr. said Cheron Shelton, 29, and Robert Thomas, 27, have each been charged with six counts of criminal homicide for the March 9 ambush in Wilkinsburg.

Thomas used a .40-caliber pistol to fire 18 shots into about 15 partygoers, prompting them to run for cover toward a rear porch where Shelton, hiding behind a fence, peppered them with 30 shots from a rifle similar to an AK-47, Zappala said. The victims all died from shots fired by Shelton, investigators said.

Zappala said Shelton apparently blamed Lamont Powell, one of three people wounded in the shootings, for the 2013 murder of Shelton's best friend.

Authorities called Powell a suspect in the 2013 killing but have never charged anyone, county police said in a news release.

The slain victims included Brittany Powell, 27, who was renting the home and living there with her child, and her siblings, Chanetta Powell, a 25-year-old pregnant woman, and Jerry Shelton, 35. The county medical examiner has ruled Chanetta Powell's unborn son died because of her death. The other victims were a cousin of the siblings, Tina Shelton, 37, and their friend, Shada Mahone, 26.

Cheron Shelton is not related to the victims and planned the shootings with Thomas after they learned of the cookout from a Facebook post and an unspecified call telling them Lamont Powell would be there, authorities wrote in court papers.

"We allege two gunmen, acting in concert, who had a motive and opportunity, undertook these crimes," Zappala said at a news conference. "Nobody else was involved in this. They planned it. They carried it out."

The suspects have been in custody on other unrelated charges since shortly after the shooting. Their attorneys have said their clients were innocent and that they've seen no evidence to the contrary. Neither immediately returned calls for comment after the charges were announced.

Both suspects are also charged with six counts each of aggravated assault and reckless endangerment for the three others wounded, as well as three other unnamed guests who were endangered by the gunfire. They're also charged with criminal conspiracy.

Wilkinsburg is a poor, largely blighted suburb just east of Pittsburgh that is known for drug trafficking and gun violence. But neighbors said the street where the shooting occurred had generally been quiet.