As midnight approached, marking the entry of the new year, across the country Spaniards prepared to celebrate in the traditional fashion – by swallowing 12 grapes to the chimes of a clock.

But in the southern city of Huelva, a gang of 12 thieves had other plans, eyeing up, as they were, a tonne of confiscated hashish held in a customs warehouse.

With no security guards on duty, the local customs headquarters in the centre of Huelva was an easy target for the thieves – who police suspect may belong to the same gang that had originally imported the hashish from nearby Morocco.

At exactly 23.59, as Spaniards gathered in front of their television sets to watch the clock chime in midnight, security cameras recorded the dozen men heading for the building's door.

Within four minutes they had forced their way through two other doors and carried three 30kg bundles of hashish each to the stolen cars waiting on the street outside. Then they drove off.

Police were called by a neighbour and a private security firm was alerted by the building's alarms, but by the time they had arrived there was no trace of the robbers.

"It is not right that the building where the drugs were being kept had no guards and insufficient security measures," said the interior minister, Jorge Fernández.

Spain's customs agency belongs to the finance ministry, but robberies of hashish from police depots have also become a common occurrence as austerity measures see authorities cut down on night security guards.

"It is shameful," Juan Carlos Contreras of the CEP police union told El País newspaper.

A similar robbery at a police deposit in Málaga, southern Spain, a year ago saw thieves take 300kg of hashish. On that occasion police took two days to discover that the drugs had been lifted from under their noses.

• This article was amended on 4 January 2012 to add the fact that there were 12 thieves in the gang that stole a tonne of hashish. This had been omitted from the article owing to an editing error.