In a shooting rampage that left five people dead, two assailants killed two Las Vegas police officers on Sunday at a pizza restaurant and fatally shot a third person at a nearby Walmart before dying in a suicide pact, the authorities said.

The attackers, one male and one female, ambushed the two police officers as they were eating lunch at a CiCi’s Pizza around 11:20 a.m., Sheriff Douglas Gillespie of Clark County said at a news conference on Sunday afternoon.

The sheriff identified the officers as Alyn Beck and Igor Soldo, and said that one of them fired at the attackers before he died, but that it was unclear whether the officer struck either assailant.

The attackers took the officers’ weapons and ammunition before they fled across the street to a Walmart store in the same plaza. There, they fatally shot one other person inside the entrance, Sheriff Gillespie said. Officers responding to the shooting confronted the man and the woman and exchanged gunfire with them, then they heard several shots, the sheriff said.