(Bloomberg) -- Pedro Castillo, the Peruvian leader ousted Wednesday for trying to dissolve congress, faces as many as 20 years in prison if found guilty of the crime of rebellion, at a time when Mexico is offering him political asylum.

Judge Juan Carlos Checkley on Thursday ordered Castillo held through Dec. 13 for additional investigations, considering him a flight risk. The seriousness of the alleged crimes of rebellion and conspiracy “augur a grave sanction,” Checkley said in his ruling.

Castillo’s decision to suspend the congress, rewrite the constitution, order a curfew and reorganize the courts “typifies the crime of rebellion,” prosecutor Marco Huaman said during the ousted president’s presentation before the judge. A suspect found guilty of such crime “shall be punished with a prison sentence of not less than 10 years and not more than 20 years,” Huaman said. 

Read More: Peru’s First Female Leader Faces Hurdles After Castillo Ousted

Castillo faced possible removal from office through an impeachment vote when he tried to dissolve congress. But his announcement triggered an immediate backlash, with ministers resigning en masse and the military speaking out against the plans. Lawmakers quickly moved to oust him for “permanent moral incapacity,” appointing Vice President Dina Boluarte as new head of state.

While local markets are closed for a public holiday until Monday, Peruvian assets abroad gained on Thursday as investors welcomed Boluarte’s administration. 

The iShares MSCI Peru ETF climbed as much as 2.4% to $29.81, the biggest gain this month. Meanwhile, dollar-denominated bonds due in 2072 rallied 1.3 cent to $71.8 cents on the dollar, the highest since August, according to indicative pricing data collected by Bloomberg.

Mexico Role

The former president was detained with his family in the streets of Lima while trying to reach the Mexican embassy to then flee Peru, Huaman said.

Mexican President Andres Manuel Lopez Obrador confirmed that Castillo reached out to his office and was en route to the embassy, but Peruvian authorities and citizens blocked access. AMLO, as the president is known, had told his foreign minister to ensure the embassy would be ready for the Peruvian leader.

“I sought Marcelo Ebrard and told him to talk to the ambassador to open the door of the embassy in adherence to our tradition of asylum,” AMLO told reporters on Thursday, referring to his foreign minister.

Castillo, 53, spent the night at the same facility that is holding former President Alberto Fujimori, author of Peru’s previous presidential coup in 1992. During the online hearing, he remained nearly silent and deferred questions to his lawyers.

The left-wing former president did not undertake an armed uprising, defense lawyer Victor Perez said. Nor are there signed documents showing that he in fact formally ordered the congress dissolved, which he announced in a video broadcast before his impeachment, he said.

Regardless of the judge’s decision, Mexico’s foreign minister published on Twitter a letter addressed to AMLO in which Castillo’s lawyer requests asylum for his client, alleging a climate of “political persecution of anyone who thinks differently” in Peru. 

Ebrard said he had begun consultations with Peruvian authorities and that Mexico’s ambassador Pablo Monroy visited the jailed ex-president in Lima. 

Read More: Peru Political Risk Lingers Post-Castillo, Strategists Warn

--With assistance from Dale Quinn, Maria Elena Vizcaino and Nacha Cattan.

(Updates with market impact in fifth paragraph.)

©2022 Bloomberg L.P.