This handout picture distributed by the Peruvian Presidency press service shows Peru's President Dina Boluarte (left) posing with Alberto Otarola, her newly sworn chief of staff, during a swearing-in ceremony at the Palace of Government in Lima on Dec 21, 2022. (VICTOR GONZALES / PERUVIAN PRESIDENCY / AFP)

LIMA/MEXICO CITY – Peru's President Dina Boluarte promoted the country's defense chief to the prime minister's job as part of a shuffle of her 11-day-old Cabinet on Wednesday, a move that followed protests this month that have left roughly two dozen people dead.

Alberto Otarola, a lawyer who had been the Andean nation's defense minister, was named prime minister, and four others entered the Cabinet. Alex Contreras and Oscar Vera were kept as the ministers of the economy and energy and mines, respectively.

Left-wing legislators denounced Otarola's appointment, blaming him for the protest-related deaths that prompted the resignation of two ministers and were triggered by the impeachment and detainment of leftist former president Pedro Castillo.

Dina Boluarte, who became president after leftist former president Pedro Castillo tried to illegally dissolve Congress and was ousted and detained, has said she is leading a transitional government and has urged legislators to move up elections

"Without any remorse, today Alberto Otarola, one of the main politicians responsible for the deaths of 26 Peruvians, is sworn in as the new premier," said Sigrid Bazan, a member of Congress.

Human rights groups have accused Peruvian authorities of using firearms against protesters and dropping smoke bombs from helicopters. The army says protesters have used weapons and homemade explosives.

ALSO READ: Peru's president to replace PM in Cabinet shakeup

Boluarte, who became president after Castillo tried to illegally dissolve Congress and was ousted and detained, has said she is leading a transitional government and has urged legislators to move up elections.

Her government is also embroiled in a diplomatic tussle with Mexico after Lima said this week that it was expelling the Mexican ambassador. That move followed Mexican President Andres Manuel Lopez Obrador's public support for Castillo.

A supporter of Peru's ousted president Pedro Castillo shouts slogans during a protest at the Plaza de Armas in Cusco, Peru, on Dec 20, 2022. (MARTIN BERNETTI / AFP)

Lopez Obrador, a leftist, said on Wednesday he would uphold diplomatic ties with Peru, though he reiterated his support for Castillo and again criticized the new Peruvian government, questioning its legitimacy.

The Mexican leader said Castillo had suffered attacks by Peru's "elite," and added that he would discuss the "prominent role" of the United States in Latin American politics during an upcoming meeting with US President Joe Biden.

READ MORE: Peru expels Mexico's ambassador as diplomatic spat deepens

Earlier, members of Castillo's family landed in Mexico City after being granted political asylum. Castillo's wife, Lilia Paredes, and their two children were seen in a photo shared by Mexico's foreign minister on Twitter.

Lopez Obrador has also said Mexico's "doors are open" to Castillo, who is currently serving 18 months of pre-trial detention while authorities investigate him for alleged rebellion and conspiracy.