RIO DE JANEIRO (AP) — A man opened fire in a cathedral in southern Brazil after Mass on Tuesday, killing four and leaving four others injured before turning a gun on himself, authorities said.

The shooting occurred right after Mass at the Metropolitan Cathedral in Campinas, a city about 60 miles (100 kilometers) north of Sao Paulo, according to Wilson Cassante, a spokesman for the archdiocese.

He told The Associated Press that the officiating priest had left before the shooting began.

A spokesman for Sao Paulo state firefighters told the AP that four injured had been taken to local hospitals. Their conditions were not immediately known.

Cassante said church officials did not recognize the shooter or have any ideas about his motive.

"It's so sad," said Cassante. "It's hard to imagine the pain this has caused."

Hamilton Caviola Filho, a police investigator, told news portal G1 that authorities had reviewed surveillance footage from inside the cathedral.

The shooter "came into the church, sat on a chair, with time to think, and then got up and starting shooting," said Caviola Filho.

The investigator also said that before shooting himself in the head, the suspect took a bullet in the ribs from responding police. In total, the suspect fired at least 20 shots, said Caviola Filho.

Images on Globo News showed paramedics taking bodies and injured from the church.

Firefighter Alexandre Monteiro told G1 that the four injured were in stable condition.

The motive was isn't clear. Authorities have yet to release the name or age of the suspect.

While Brazil leads the world in total annual homicides, mass shootings are relatively rare.