RIO DE JANEIRO (AP) — Police officers pursuing fleeing suspects clashed with people at a street party in a Sao Paulo slum, setting off a stampede in which nine people died, Brazilian officials said Sunday.

The state’s security agency said police were carrying out an operation when they were attacked by two men on a motorcycle and officers gave chase amid gunfire. The suspects fled into the street party attended by thousands of people in the Paraisopolis district.

Police spokesman Emerson Massera told Globo news that officers were met with rocks and bottles even as the suspects continued firing, and police responded by firing rubber bullets and tear gas.

People then tried to flee down a narrow street and some were trampled, with nine pronounced dead at a hospital, according to police. Seven others were treated for injuries.

“The criminals used the people who were at the dance as human shields to block the police chase,” Massera said.

Neighbors and relatives of victims disputed the account by police, telling local media that officers blocked exits from the dance area and then used gas. Some also claimed to have been beaten by police.

Dances are often organized within communities by criminal gangs that control neighborhoods.