MONDA, Spain (Reuters) - Six workers trapped in squalid, airless conditions were rescued from an elaborate cannabis farm and counterfeit tobacco factory hidden beneath a mountain village in Spain after police arrested the suspected masterminds of the operation.

The secret operation, complete with machinery that could produce up to 3,500 cigarettes an hour, was hidden in a maze of tunnels accessible only through a trapdoor covered with hay in a stable block, the Interior Ministry said on Thursday.

But once the suspected kingpins were seized, no one replenished the generator that provided oxygen to the workers, a mix of Ukrainian and Lithuanian nationals.

This left them gasping for air as they shouted and banged on the soundproofed trapdoor to raise the alarm to the police investigating above their heads.

“Once inside, the police agents saw with great surprise the six workers who were struggling to breathe in an utterly insalubrious atmosphere,” police said.

“If the officials had not found the clandestine factory in time, the lack of oxygen would have soon made ... the underground conditions incompatible with the survival of the workers who were there.”

The underground factory in Monda, near Malaga in southern Spain, housed an indoor cannabis plantation and sophisticated machinery enabling even the plastification of cigarette packs, all kept away from prying eyes by “enormous security measures”, according to police documents.

Slideshow ( 11 images )

In its statement, the ministry said it was the first subterranean illegal tobacco plant discovered in Europe.

Spanish police, working alongside Interpol in the sting operation dubbed “Hannibal”, confiscated 153,000 packs of cigarettes, more than 17 tonnes of rolling tobacco, 20 kg of hashish and 144 kg of marijuana.

Twelve Britons suspected of leading the operation were arrested and are being held in custody.

The six workers were freed pending the outcome of the investigation.

“The investigating judge will decide their degree of responsibility,” a police spokesman said.