The government of Ecuador has condemned what it described as an attempt by a US federal immigration agent to enter the Ecuadorian 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'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. The authorities of the country where the consulate is located shall not enter parts of the consulate used for work except with the consent of the head of the consular post.

Ecuador stated that its officials had not consented to ICE entering the consulate, and incidents warranting assumed consent under the convention are limited to emergencies.

A video from Ecuadorian media showed a consular official telling an ICE agent, this is the consulate, you're not allowed in here, to which the agent responded, if you touch me, I will grab you. The consular official reiterated the consulate's inviolability before closing the door.

Ecuador's foreign ministry has issued a letter of protest to the US embassy in Quito, marking a notable point of disagreement between President Daniel Noboa and the Trump administration.

Recent US immigration operations in Minneapolis, characterized by violence, have prompted widespread protests. President Trump recently stated he would "de-escalate" immigration operations in the region.