A gang has rammed several vehicles into a prison in central Mexico and escaped with nine inmates in one of the most dramatic breakouts the country has seen in recent years.

Authorities in the state of Hidalgo, north of Mexico City, said the massive pre-dawn attack resulted in non-life threatening gunshot wounds to two police officers.

“It was gunfire that lasted for almost an hour,” said Tula resident Sergio Mesa, who was woken by the sound of explosions or detonations at around 4am.

State police said soldiers, police and National Guard troops had fanned out looking for the escaped inmates.

Police did not identify the armed gang involved in the prison break, but suggested one may be a gang leader.

The state’s interior secretary, Simon Vargas, said: “An armed group burst into the prison aboard several vehicles, and it is worth noting that near the prison, two vehicles were burned as part of the criminal group’s operation, as a distraction.”

Mexico Prison Break
Forensic investigators check a burned-out car (Ginnette Riquelme/AP)

Local media reported that the burned-out cars found in the city of Tula after the attack were car bombs. Authorities said they were investigating how the vehicles caught fire.

However, the condition of the two vehicles — parts were blown dozens of yards away, and the floor of one car appeared to have been punched through by a blast — suggested it was more than merely a fire.

The use of car bombs by gangs in Mexico has been extremely rare, with one attack in the northern border city of Ciudad Juarez in 2010 killing three people.

Gangs in Mexico frequently torch vehicles to distract police, and vehicles set alight can explode once the flames reach their fuel tanks.

Tula is home to a large oil refinery and the area has been plagued by gangs of thieves who drill illegal taps into government-owned pipelines to extract petrol and diesel.

It was unclear if any fuel thieves were among the escaped inmates. Authorities said the escapees had faced charges of homicide and kidnapping, among others.

State prosecutor Alejandro Habib said a large number of people took part in the apparently highly planned attack.

Mexico has seen some spectacular prison escapes in the past.

In 2015, imprisoned drug lord Joaquin “El Chapo” Guzman escaped through a mile-long tunnel on a specially modified motorcycle that ran on steel rails.

He was later recaptured, extradited and is serving a prison term in the US.

In 2012, more than 130 inmates escaped a border town prison in Piedras Negras through a tunnel.

In 2010 in the northern border state of Tamaulipas, 141 inmates got out through a prison service entrance used by vehicles, presumably with the assistance of staff.