Rescuers raced Thursday to free 10 workers trapped in a coal mine after a cave-in in northern Mexico, where desperate relatives spent a sleepless night waiting for news.

Dozens of military personnel, emergency workers and rescue dogs were deployed after flooding caused the collapse Wednesday in Sabinas in the state of Coahuila, President Andres Manuel Lopez Obrador said.

Relatives hug and cry after a coal mine collapsed in Mexico's northern state of Coahuila, where around nine people were reported to be trapped
Relatives hug and cry after a coal mine collapsed in Mexico's northern state of Coahuila, where around nine people were reported to be trapped AFP / Marcos Gonzalez

"What I want with all my soul is that we rescue the miners," he told reporters.

"We must not lose faith. We must not lose hope," he added.

Five miners managed to escape alive and were taken to hospital, civil defense national coordinator Laura Velazquez said, adding that two had been discharged.

Rescue personnel work at a coal mine in northern Mexico where around nine people were believed to be trapped
Rescue personnel work at a coal mine in northern Mexico where around nine people were believed to be trapped AFP / Marcos Gonzalez

"Time is crucial here," she said.

"To get to the mines you have to go down three shafts. It's complicated but we've been managing to do it, pumping out water... to rescue the miners as soon as possible," Velazquez added.

The coal mine where 10 miners were trapped after a cave-in in Sabinas in Mexico's Coahuila state
The coal mine where 10 miners were trapped after a cave-in in Sabinas in Mexico's Coahuila state AFP / Marcos Gonzalez

Anxious relatives gathered to wait for news, with some crying and comforting each other at the site, about 1,130 kilometers (700 miles) north of Mexico City.

A relative of a miner waits for news after a Mexican coal mine collapsed
A relative of a miner waits for news after a Mexican coal mine collapsed AFP / Marcos Gonzalez

"Unfortunately, there's not much hope," Jose Luis Amaya, whose cousin and brother-in-law were among those trapped, told Milenio TV on Wednesday night.

The mother of one of the workers wept inconsolably, unable to answer questions from the press.

Through tears, another woman at the scene said two of her children worked in the mine, though one of them had managed to escape after the accident.

As night fell hours later, the families gathered under tents outside the mine in silence as state police, the national guard, medical teams and other rescuers worked to find the trapped workers.

Coahuila's state government said that the miners had been carrying out excavation work when they hit an adjoining area full of water, causing the shaft to collapse and flood.

"The mine began operating in January of this year and until now there have been no reports of any type of anomaly," it said in a statement.

State governor Miguel Riquelme said he had asked labor authorities and the local prosecutor's office to prioritize the rescue and investigation.

Coahuila, the country's main coal-producing region, has seen a series of fatal mining accidents over the years.

The worst was an explosion that claimed 65 lives at the Pasta de Conchos mine in 2006.

Last year, seven miners died when they were trapped after another accident in Coahuila.