Brazilian police have foiled an audacious plot to steal £250m ($331m) from a bank in São Paulo via a 500-metre underground tunnel complete with electric lighting and a ventilation system.

Investigators say the gang planned to break into a São Paulo branch of the government-owned Banco do Brasil through the tunnel, which had been dug from a nearby rented property.

If successful, the robbery would have dwarfed the biggest bank heist in the country’s history, when thieves tunneled into the Fortaleza brach of the Central Bank and stole 165m Brazilian reais.

“This would have been the biggest bank robbery in the world,” chief investigator Fabio Pinheiro Lopes told the Guardian.

“They are an extremely dangerous and organised gang with a long history, including some violent crimes like homicide. If you look at their ages most are above 35 – well above the age of your average Brazilian criminal,” he added.

Prisoners accused of digging the tunnel, which allegedly took four months to build. Photograph: Lopes/Zuma Wire/Rex/Shutterstock

Sixteen suspects were arrested at a warehouse on Monday night in the northern suburbs of the city where the gang stored tools to dig the tunnel and tracks to remove the money. Altogether, police say 20 members of the gang invested 200,000 Brazilian reais ($64,000) each – a total of 4m reais for the robbery. Police monitored the group for more than two months.

Authorities believe some suspects were involved with a 2011 robbery in São Paulo of 170 personal safes at a branch of the Itaú bank. Lopes said members of the gang were not connected to the Fortaleza Central Bank heist, as had been reported in the Brazilian media.

The tunnel, which allegedly took four months to build, was illuminated and ventilated and supported by wood and iron. Police are looking for a woman who rented the house for the gang using false identity.

The robbery was allegedly planned for Friday or the weekend and seven stolen cars – found at the gang’s hideout – would have been used to transport the money.

Police named Alceu Céu Gomes Nogueira, 35, as the ringleader of the gang and they also accuse him of helping mastermind a huge robbery on a cash storage vault in Paraguay near the Brazilian border earlier this year, when thieves made off with some $13m (£9.8m) after using grenades, explosives and assault rifles. One police officer was killed.

Lopes also said police were investigating connections to the First Command of the Capital (PCC), a São Paulo drug trafficking gang also believed to have been linked to the Paraguay robbery.

“For an operation this size and expense, the PCC were most likely financing it,” Rafael Saliés, a risk consultant, at Southern Pulse Intelligence.

Local media reported that the failed heist’s ringleader Nogueira commanded a prison riot in 2006 at the behest of the PCC, the same year the gang mounted a series of bloody attacks which brought São Paulo to its knees.

The tunnel was illuminated and ventilated and supported by wood and iron. Photograph: Marcelo Chello/Rex/Shutterstock

Hundreds are thought to have been killed in the ensuing violence. The gang was blamed for starting the violence but many killings were attributed to police death squads.

Another suspect from the foiled São Paulo heist, Marcos Paulo Chini – a fugitive from Pedrinhas prison in Maranhão – is also believed to be working with the PCC gang.

Born in the São Paulo’s wretched prison system in the 1990s, the PCC is today considered Brazil’s most powerful organised crime group with some 22,000 members according to local sources.

In recent years, the gang has expanded its reach across the country. The expansion was blamed for a series of prison deaths in Brazil’s northern states at the beginning of the year.