MEXICO CITY  Armed men dressed as Mexican federal police officers entered a heavily guarded prison in the northern state of Zacatecas early Saturday morning and freed more than 50 inmates, many of whom were believed to be drug traffickers allied with the powerful Gulf Cartel, the authorities said.

The huge jailbreak, which took place about 5 a.m., was an embarrassment to the government of President Felipe Calderón, who has touted the arrests of thousands of drug traffickers over the last two years as evidence that organized crime groups were on the defensive.

The team of criminals who gained entry to the prison in Cieneguillas showed how vulnerable Mexican institutions remain.

The men arrived in a caravan of 15 vehicles with police markings as well as in a helicopter, according to news reports. To gain entry, the gunmen claimed that they were carrying out an authorized prisoner transfer.