It all went down dramatically on Wednesday when former Peru President Pedro Castillo was removed from office for rebellion.

Meanwhile, Mexico has indicated that it may grant him asylum, per BBC.

Ousted Peruvian President Pedro Castillo has requested asylum in Mexico and delivered the request to the country's president through his lawyer.

Mexico's Foreign Minister Marcelo Ebrard said negotiations are underway to resolve the dispute.

Castillo's attorney pleaded with Mexican President Andrés Manuel López Obrador to "consider granting asylum ... in the face of the unfounded persecution of justice bodies" in a letter he delivered to him late on Wednesday.

"They intend to prosecute him for mere announcements of will or intention that do not constitute any criminal offence," the letter added.

Ebrard claims that Castillo met with Mexican ambassador Monroy in Lima. He reported that the ex-president is in good health and spending time with his attorney.

New Peru President Dina Boluarte was Castillo's running mate in the 2021 election.

On Wednesday, when he tried to get rid of Congress, she quickly broke away from him, calling it an "attempted coup."

Following her inauguration, she called for "national unity" among Peruvians and a "truce" to help her combat corruption.

READ NEXT: Dina Boluarte Is Peru's First Female President After Pedro Castillo Gets Arrested: Who Is She and How Did She Take Presidential Seat? 

Ousted Peruvian President Pedro Castillo Placed at the Same Jail as Ex-Leader Alberto Fujimori

On Wednesday, Castillo was removed from office after he attempted to dissolve Congress to illegally maintain his hold on power.

His strategy backfired, and now even his ministers are working against him, U.S. News reported.

A few hours later, he was detained. On Wednesday night, TV images showed him arriving in a helicopter with his hands tied together and covered with a blanket at the headquarters of the Department of Special Operations (Diroes) east of the capital.

His hands were bound together, and numerous security measures were in place.

A legal source confimed Thursday that 53-year-old leftist Castillo is in the same cell as Alberto Fujimori, the former dictator of Peru from 1990 to 2000. The latter is serving a 25-year sentence for human rights abuses and corruption.

Ousted Peruvian President Pedro Castillo is Welcome in Mexico

On Thursday, Mexican President Andres Manuel Lopez Obrador clarified that he would grant Castillo asylum. Lopez Obrador is a fellow leftist and has previously stated that he likes Castillo.

According to Lopez Obrador's comments to the press, Castillo called Lopez Obrador on Wednesday to tell him he was on his way to the Mexican embassy in Lima to seek asylum.

Local news reports say Castillo never got there because his security team arrested him.

The leader of Mexico said that he had told his foreign minister to let Castillo into the embassy.

Castillo reportedly met with the Mexican ambassador in Lima on Thursday afternoon, according to a tweet posted by Mexican Foreign Minister Marcelo Ebrard.

Officials told him in Mexico and Peru that they had begun discussing his asylum request and would update him later.

According to Reuters, the Mexican government has a long history of providing political asylum to persecuted foreign leaders, including those who opposed fascist dictator Francisco Franco in 20th century Spain and Bolivia's former president Evo Morales, who fled the nation in 2019 during demonstrations over a disputed election.

Although Lopez Obrador has frequently advocated for a hands-off approach to international politics, he has shown a preference for leaders he sees as ideological soulmates.

However, a few Peruvian lawmakers, including the committee head for international affairs, urged Lopez Obrador to stay out of Peru's internal affairs.

READ MORE: Texas: Ex-Border Patrol Agent Who Brutally Killed 4 Women by Shooting Them in Their Heads Charged With Capital Murder 

This article is owned by Latin Post.

Written by: Bert Hoover

WATCH: Peruvian President Pedro Castillo Is Ousted & Arrested in Latest Episode of Peru's "Enduring Crisis" - From Democracy Now!