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 stated that the ICE agent had tried to enter the premises of the consulate at 11:00 local time on Tuesday.

The 1963 Vienna Convention on Consular Relations declares that consular premises are considered inviolable, and that authorities of the host country shall not enter without consent. Ecuador asserted that its officials did not consent to ICE entering the consulate.

In a video shared by Ecuadorean media, an official can be seen confronting the ICE agent and asserting that the consulate is not permissible for entry. The agent responded threateningly stating, if you touch me, I will grab you. Ecuador has since lodged a formal protest with the US embassy in Quito, marking a significant moment of discord between Ecuadorean President Daniel Noboa and the Trump administration.