At least 19 people have been killed and seven injured within the span of less than three hours in a wave of shootings in Brazil's largest city Sao Paulo, officials have said.

Alexandre de Moraes, the head of the city's state security body, told reporters on Friday that police were trying to determine if the overnight shootings in the western suburbs of Osasco, Barueri and Itapevi were related.

De Moraes said 15 of the victims were shot dead in different areas of Osasco, three were killed in Barueri and one in Itapevi. Seven others were wounded and hospitalised. 

Media reports said all the attacks occurred in a period of about two hours and a half.

The Globo News television channel broadcast security camera footage showing a group of masked assailants entering a bar in Osaca, ordering customers to raise their hands, and then shooting them.

Ten of those killed were killed in the bar.

Not far away, one young man was shot outside an ice cream store and another man was shot by two men riding a motorcycle.

Jorge Lapas, the mayor of Osasco, said the killings could have been in reprisal for the recent deaths of two police officers who were shot.

"We want to take measures so that the situation does not worsen over the coming days," said Lapas.

Citing witnesses, de Moraes said that in at least two instances, gunmen wearing face masks arrived and asked who had criminal histories. Those who said they did were shot.

"We will investigate if the killings were committed by drug traffickers, by off-duty police officers or were acts of vengeance for the recent killings of two police officers," said de Moraes.

Source: Agencies