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 from 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 stated that the ICE agent tried to enter the premises at 11:00 local time (17:00 GMT) on Tuesday.

According to 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 the parts of the consulate used for work except with the consent of the head of the consular post.

Ecuador indicated that its officials had not consented to ICE entering the consulate. While the Vienna Convention allows for some assumed consent under circumstances requiring prompt protective action, those situations are typically limited to emergencies.

In a video shared by Ecuadorean media, an official is seen rushing to the door, asserting that the consulate is off-limits to the ICE agent. When the ICE agent suggests he will respond physically if touched, the consular official reiterates that he cannot enter.

Ecuador's foreign ministry promptly handed an official letter of protest to the US embassy in Quito, marking a rare moment of discord between Ecuador's President Daniel Noboa and the Trump administration, which has previously enjoyed cooperative trade relations.

The actions of immigration and border agents have sparked protests in Minneapolis, further intensified by recent fatal incidents involving local border agents.