Four innocent people have been shot dead and at least four more wounded after a gunman opened fire inside a cathedral in Brazil then killed himself.

The man entered the Metropolitan Cathedral in Campinas, 60 miles from Sao Paulo, just after Mass at around 1pm today before walking to the front and opening fire.

Police named the alleged shooter as 49-year-old Euler Fernando Gandolpho - a systems analyst with no criminal record.

Globo News reported that the suspect used two handguns to fire into the congregation before shooting himself dead at the altar after randomly targeting and killing worshippers.

The suspect is believed to be among the fatalities and was allegedly shot first by an officer before taking his own life.

At least 20 shots were allegedly fired by the gunman, who police say could have been shot once by officers before he turned the weapon on himself.

An eye witness said the shooting happened right after Mass was celebrated and that the officiating priest had left before the killing began.

One victim was killed at the door of the cathedral, with paramedics seen treating an injured person in the open doorway.

Scroll down for video.

A gunman, named by police as 49-year-old Euler Gandolpho, allegedly shot four people dead and wounded four after opening fire during midday Mass at a Catholic cathedral in Brazil before killing himself

Sao Paulo Police named the alleged gunman as 49-year-old Euler Fernando Gandolpho

Police say the man walked into the cathedral around 1pm with two handguns before shooting one person dead at the door (pictured) and advancing inside

Paramedics and police officers help victims of the deadly shooting at the Metropolitan Cathedral, in Campinas, Sao Paulo state, in Brazil earlier today

Five people in total are said to have died, including the gunman, along with an 84-year-old man, a 65-year-old woman and a 40-year-old woman, all said to be among the injured survivors.

'I had started to celebrate mass at 12:15 pm and at the end of the mass, a man entered and shot at his victims. Nobody was able to do anything,' priest Amaury Thomazi said in a video published on social media.

An image of a man, thought to be Gandolpho, slumped on a pew near the altar with a gun in his hand has been confirmed as the suspect by police.

Security guard, Alexandre Moraes, told local media: 'The people in the church were mostly elderly, innocent people, and he [the suspect] ended up firing on all these people. The scene is desperate, it is a very great tragedy.'

Emergency services were first called to the building around 1.20pm.

A 65-year-old woman was taken to hospital with upper body injuries, while another, aged 40, was also taken to hospital, though her injuries and condition are unknown.

A third survivor is reported to be in a stable condition, though no more information is available about their injuries.

Reuters reported that a fourth person was also injured, adding that all of the victims were elderly and in a serious condition.

CCTV video released by the Metropolitan Cathedral of Campinas showed the moment the alleged gunman got up from a pew on the far left bottom of the screen and started to open fire on worshippers sat close beside him.

He appeared to move through the pews into the central aisle and continued firing randomly at parishioners as they ran for their lives.

Then walking to the far right hand side he seemed to stand while he reloaded his weapon.

ID document of the alleged gunman named by police in Brazil as as Euler Fernando Gandolpho, which has also been spelt 'Gandolfo' in some reports

Paramedics treating survivors at the scene. Police are investigating the shooting but have not revealed a suspected motive

The area around the cathedral was cordoned off while paramedics rushed the wounded to hospital. All four are reported to be in a serious condition

Crowds gathered around the cathedral as news of the mass shooting, which is relatively rare in Brazil, began to spread

This split second moment allowed a petrified woman who had hidden, crouched down between the seats, to jump up and escape before she was shot.

Within seconds of the rampage unfolding, police patrolling the area, because of the increased crowds during the festive season, were on the scene.

Pedro Rodrigues, 66, said: 'I suddenly saw a man stand up, take position in front of a couple and shoot them point blank. I ran out fast and he continued firing, many shots.'

At least two officers were seen entering the Cathedral with guns pointed and appear to open fire on the assailant, who had apparently made his way to the altar.

The man was armed with a revolver and a .38-caliber pistol, according to police.

Firefighter Alexandre Moraes said: 'The people in the church were mostly elderly, innocent people, and he [the suspect] ended up firing on all these people. The scene is desperate, it is a great tragedy.'

Moraes also told the Globo News channel: 'It was frightful. He entered and shot randomly at people. They were all praying.'

Gandolpho, a systems analyst from Valinhos, in the state of Sao Paulo, with no criminal record, had two guns with 28 rounds left when he died.

Television images showed the lifeless body of the gunman, wearing jeans and a blue t-shirt, lying inside the cathedral, holding a discharged pistol in his right hand.

The area surrounding the Cathedral has been cordoned off.

An image of a man slumped on a pew near the altar with a gun in his hand has been confirmed as the suspect by police

Crowds and emergency services outside the Metropolitan Cathedral in Campinas after a gunman walked in to the holy building and began randomly shooting worshippers

Wilson Cassante, a spokesman for the Campinas archdiocese said the shooting happened right after Mass was celebrated, adding that the officiating priest had left before the shooting began.

A spokesman for Sao Paulo state firefighters told the Associated Press that four injured people had been taken to local hospitals.

Their conditions were not immediately known.

Cassante said church officials did not recognise 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.'

Globo News reported that the man entered went to the front of the church and began shooting from two handguns after sitting down in a pew.

'A man opened fire randomly on people inside until police intervened and shot at the gunman who then killed himself,' the Security Secretariat for the state of Sao Paulo said in a statement.

Confused pedestrians gather around the cathedral steps after hearing gunshots and before emergency workers arrive in Campinas

People gathering outside the Cathedral of Campinas, 90 km northwest of Sao Paulo, Brazil, today after the fatal shooting

Municipal workers carry a body from the Cathedral of Campinas after a man opened fire during mass earlier today

It added, 'as well as [the gunman], four people died and four people were wounded.'

That figure corrected an earlier police toll that had given a total of six dead including the gunman and three wounded.

The motive was isn't clear at this stage and the authorities have yet to release the name or age of the suspect.

The fatalities have not been identified and police are still investigating.

Police chief, Hamilton Caviola, said the shocking scenes were recorded on CCTV cameras inside the church at the time of the incident.

He believes the gunman fired a hail of at least 20 shots and allegedly had two guns.

Chief Caviola said: 'From the images, [the suspect] appeared to sit down about ten metres from the front of the door. He did not shoot at first but sat on a bench.'

According to Caviola, shortly after the alleged shooter entered, three people came in and sat on the pew behind him.

They were believed to be the first to be hit and one of the victims in this group is reported to have died.

The chief added: '[The suspect] used one gun, but it appears he had two with him.

'The motivation behind the crime will only be known when we identify him and know his history.

Municipal guards stand next to a covered body at the entrance of the Cathedral of Campinas, Brazil today

Brazilian TV reported in unconfirmed footage that the gunman may have been seen in the street moments before the church shooting

A frame taken from a security camera, as police officers help victims of the shooting at the Metropolitan Cathedral, in Campinas, Sao Paulo state, Brazil

'For now from the images we watched on the security footage it appears he [the shooter] stopped, thought and executed the plan that he had in his head.

'He killed himself, but we believe a policeman must have shot him because he was shot in the rib. After being hit we think he fell and killed himself.'

Major Adriano Augusto also told the TV news station Globo that the gunman stood up shortly after the prayers had ended.

'He first hit the people on the bench behind him,' Major Augusto said. 'Apparently he shot in several directions, not directed at anyone specifically.'

Emergency services were dispatched to the scene around 1:20 pm.

The initial reports suggest that a woman of 65 years was left with upper body injuries and was taken to the Mário Gatti Hospital, where she is reported to be out of danger.

An 84-year-old man, who was believed to be hit in the chest and abdomen was taken to the same hospital and is undergoing emergency surgery.

A 40-year-old woman was taken to Unicamp of Clinics Hospital and is reported to be in a stable condition. There is no information on what unit the fourth victim was taken to or the state of their health.

The area surrounding the Cathedral has been cordoned off and CCTV monitoring cameras showing the rescue by ambulance crew recorded the emergency operation in the area.

In a statement Campinas Municipal Authority said that it has mobilised all emergency units to the scene.

Firefighters at the scene today next to a victim killed at the Metropolitan Cathedral in Campinas, Brazil

Workers remove bodies of victims from the Cathedral of Campinas after a man opened fire during mass and killed at least four people before committing suicide

The cathedral, which was founded in 1883, sits at the centre of Campinas in a public square

Mayor, Jonas Donizette said: '[We are] appalled by the brutal crime and dedicate our prayers to the victims and their families.'

The Archdiocese of Campinas lamented the tragedy today, posting a message on social media calling for people to pray for the victims and expressing their 'deep pain'.

It acknowledged the shooting and said in a statement: 'The Cathedral remains closed for the care of the victims and the investigation by Police.

'Once we have more information, we will make it available. We count on the prayers of all in this moment of deep pain.'

'Everybody ran out. You can imagine that I'm shocked,' one woman who was attending the mass told Globo TV.

Brazil had nearly 64,000 murders last year - more than any other country, according to the United Nations. However, random mass shootings are relatively rare.

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

Seventy percent of murders in Brazil are committed with firearm, according to a monitoring group, Forum for Public Security.

The country's incoming president, Jair Bolsonaro, who takes office on January 1, easily won November elections on a platform that included promises to ruthlessly crack down on crime and ease gun laws to allow 'good' people to defend themselves.