An old-school bank heist was foiled in Sao Paulo after police discovered an elaborate tunnel leading to a branch of the Bank of Brazil.

Some 16 people have been arrested as a result of the discovery in what investigators say could have been "the biggest bank robbery in the world.”

Those arrested were reportedly detained in the north of the city, where they allegedly manufactured the tools for their ingenious excavation, following a two-month-long police investigation.

READ MORE: What the fork? ATM stolen with heavy machinery in Arkansas (VIDEO)

"The gang's investment was in the range of 4 million real (US$1.27 million), they said, each of the participants put in 200,000 real (US$6,340) and their estimate was to take 1 billion real (US$317 million). It would be the biggest assault in the world," said lead investigator of the case Fábio Pinheiro Lopes on Monday.

The excavation of the 500-meter-long tunnel began four months ago and was completed on Wednesday, forcing investigators to move in on the group whom they had been monitoring.

Lopes said while the gang didn’t gain access to the safe, they did make it into the shell of the vault. “That's why we decided to do the operation and arrest almost everyone. We arrested the leaders, if any [integral] escaped was labor," said Lopes.

READ MORE: Blowtorch criminals set cash alight in bungled ATM robbery (PHOTO)

The tunnel, supported with wood and iron bars, began under a rented house located near the bank in Chácara Santo Antonio.

Investigators said the premises was stocked with lots of food and tools to keep the secret operation moving.

The gang is known to police, reports globo.com, and some of the members were believed to be involved in the robbery of the Central Bank of Fortaleza in 2005 and at Itau in Paulista in 2011. “It’s a very organized gang,” said Lopes.