Brazilian police this week foiled a criminal plot to rob a bank of 1 billion reais ($318 million, 270 million euros) using an enormous secret tunnel.

A team of 16 prospective bank robbers had dug a tunnel nearly 600-meters (2000 feet) long, running from a nearby rental house to a Sao Paulo branch of government-owned Banco do Brazil.

The Sao Paulo state Public Safety Department said on Tuesday the gang had been under surveillance for three months before the tunnel was discovered. The gang allegedly spent about $1.27 million building the tunnel, with the cost split among its participants.

Read more: Military police gain precarious control after Brazil prison chaos

Work on the tunnel began four months ago and the project was impressively equipped.

Police allege the leader of the gang was a 35-year-old woman implicated in an attempted robbery of a security van in Paraguay. The court ruled the group be held in pre-trial detention.

The group dug the tunnel by hand, loading the soil into sacks and carrying it through a fork in the tunnel to an underground storm water drain, El Globo reported.

Long drug tunnel found in US-Mexico border city Tijuana

To enter the tunnel, gang members descended a two meter ladder from one of the rooms in the rented house. The tunnel was about 1.5 meters high and was reinforced with iron beams and wood, and was even wired with lights.

The walls were lined with plastic garbage bags to reduce the dust, the national daily reported.

The house was reportedly filled with food, water, special clothing and digging tools.

Police were probing whether the gang had the assistance of a engineer when building the tunnel, local daily Agora reported.

The tunnel renewed memories of a tunnel robbery 12 years ago when thieves made off with about $70 million.

On that tunnel, diggers worked in shifts from 8 p.m. until 4 a.m., taking a break on weekends, Estadao reported in 2015. Three gang members involved in that attempt were involved in two separate prison escapes using tunnels equipped with ventilation and lighting.

aw/rc (AP, AFP)