The government of Ecuador has condemned what it described as an attempt by a US federal immigration agent to enter the Ecuadorean consulate in Minneapolis.

The agent was prevented from gaining access by consular officials, who acted to guarantee the protection of the Ecuadoreans who were inside the consulate at the time, a statement by Ecuador's foreign ministry said.

Ecuador, whose president is an ally of Trump, has filed an official complaint.

The incident comes at a time of high tension in the US city, just days after intensive care nurse Alex Pretti was shot dead by border agents during protests against the Trump administration's immigration crackdown in Minneapolis.

Ecuador's foreign ministry said in a statement that an agent of the US Immigration and Customs Enforcement agency (ICE) had tried to enter the premises of the consulate at 11:00 local time (17:00 GMT) on Tuesday.

Under the 1963 Vienna Convention on Consular Relations, consular premises are considered inviolable. According to the Convention, the authorities of the country where the consulate is located shall not enter the parts of the consulate used for work except with the consent of the head of the consular post.

Ecuador said that its officials had not consented to ICE entering the consulate.

In a video shared by Ecuadorean media, a consular official can be seen telling an ICE agent that they are not allowed to enter. The agent responds, stating that any physical contact would lead to an escalation. The situation concluded with the consular official reiterating the consulate's authority and closing the door.

In its statement, Ecuador's foreign ministry said that it had immediately handed a letter of protest to the US embassy in Quito. This protest letter marks a rare discord between Ecuadorean President Daniel Noboa and the Trump administration, despite recent agreements to strengthen economic relations.

The actions of immigration and border agents in Minneapolis, particularly related to the fatal shooting of Pretti, have provoked public protests. President Trump has indicated plans to de-escalate immigration operations amidst the tensions in Minnesota.