CIUDAD JUAREZ, MEXICO -- The head of Mexico's immigration agency was arraigned on charges Tuesday that he failed in his responsibility to protect those in his custody when 40 migrants died in a fire at a border detention centre last month.

Federal prosecutors said that there are video recordings showing that private security guards in the facility had asked immigration agents permission to release the migrants when the fire started, but were denied.

Prosecutors presented evidence that Francisco Garduno, the head of the Mexican Immigration Institute, was responsible for the safety of country's immigration facilities. They said Garduno had received photographs of an expansion of the Ciudad Juarez facility in July of last year that showed it lacked basic safety measures and should have led him to shut it down.

A judge denied prosecutors' request that Garduno be removed from his position and be barred from leaving the country. His next hearing was scheduled for Sunday.

A migrant allegedly started a fire inside the Ciudad Juarez detention centre March 27. Security cameras inside the facility showed smoke quickly filling the cell holding 68 male migrants, but no one with keys attempting to release them. The feeds for those cameras were streamed to a monitoring centre in Mexico City where officials noted problems with the private security company that Garduno was made aware of, but failed to rectify, prosecutors said.

In addition to the 40 killed, more than two dozen were injured in the fire.

Garduno has not stepped down from his post, and President Andres Manuel Lopez Obrador has voiced his support. The president appointed Garduno to run the agency in 2019 while under pressure from then U.S. President Donald Trump to take a more aggressive stance against migrants crossing Mexico.

Garduno had previously been in charge of Mexico's prisons.

Prosecutors also spoke of nefarious dealings inside the facility and some migrants in their statements recounted how they had been told they would be freed if they paid $1,000. They said cigarettes and other contraband were sold to detainees, something Garduno was told about.

Migrants often lacked water in detention and some complained that groups of Venezuelan migrants were allowed to lord over others, taking their food, prosecutors said.

In various hearings related to the case, prosecutors have made clear the facility lacked basic measures to protect against fire, was improperly equipped with highly flammable foam mattresses, often failed to register all of the migrants held there and held people for far longer than the 36 hours permitted.

Rodolfo Perez, Garduno's lawyer, told reporters that in the next hearing, he would show that Garduno had put changes in motion to support migrants and improve conditions in the agency's facilities.

So far, the highest ranking official headed to trial is the immigration agency's delegate in the state of Chihuahua, retired Navy Rear Adm. Salvador Gonzalez. He was charged with homicide and causing injury by omission among other charges.

Prosecutors had previously said that they identified "a pattern of irresponsibility and repeated omissions" in the immigration institute.

The turmoil in Mexico's immigration agency comes at a time when several thousand migrants are walking north from near the Guatemalan border in protest of the deadly fire and calling for Mexico to close its detention centres.

Seven of the migrants and activists accompanying them on Tuesday sewed their lips shut in protest over the lack of a government response to their request for dialogue.

The migrants walked to the town of Huixtla, some 25 miles (40 kilometres) from Tapachula where they started their walk Sunday.

They are asking authorities to provide them with buses -- there are many families with young children among them -- or at least with temporary documents that would give them free transit through the country. So far, authorities have not made any attempt to stop them.

Irineo Mujica, of the migrant advocacy group People without Borders, was one of those who sewed his mouth shut. "It hurts a little, but the injustice toward the immigrant community hurts more," he said. "None of those here want to be death number 41."

It also plays out just weeks before the United States government is expected to end the pandemic-era restrictions on asylum at the border and implement new measures that authorities hope will deter a new rush to the border.

----

AP writer Edgar H. Clemente in Huixtla, Mexico contributed to this report.