Police investigating a deadly shooting in a cathedral in the Brazilian city of Campinas have identified the gunman.
Euler Fernando Grandolpho opened fire in the Metropolitan Cathedral after midday Mass on Tuesday.
Four people were killed and four more injured before the 49-year-old turned the gun on himself after being shot by police.
Officers said the systems analyst had no criminal record and "no motive except for his own madness".
While gun crime is common in Brazil, shootings of this nature and especially in a place of worship are not.
President-elect Jair Bolsonaro described the shooting as "a barbaric crime" on Twitter and the mayor of Campinas has declared three days of official mourning.
Police said the tragedy could have been much worse if more people had been inside the cathedral at the time.
Midday Mass was under way when the man, who was later found to be armed with two weapons, walked in and sat down in a pew.
Eyewitnesses said that after the Mass finished, he turned around and shot the worshippers who had sat down behind him, one of whom died.
Pedro Rodrigues was inside the cathedral when it happened: "I saw a man get up and position himself in front of a couple and he fired at point blank range at that couple. Then, my reaction was to run out and various other people left running with me. The man continued shooting, there were a lot of shots."
Police rushed in from the square outside but the gunman managed to fire about 20 shots before he was himself hit by a bullet in the side. He then shot himself in the head in front of the altar.
The Campinas police chief said they had found no links between the gunman and his victims.
Military police had at first said that five people had been killed but later corrected the figure to four.
They were named as 39-year-old Sidnei Vitor Monteiro, 68-year-old José Eudes Gonzaga Ferreira, Cristofer Gonçalves dos Santos, 38, and Elpídio Alves Coutinho, 67.