In 1989, President George H. W. Bush ordered a military invasion of Panama for the purpose of arresting President Manuel Noriega of Panama and bringing him back to the United States to face domestic criminal charges for narcotics trafficking.
This was very different from all other military actions the United States engaged in since the US cavalry went into Mexico in search of Pancho Villa. In all other instances, the US military crossed national borders to fight a war, conduct peace keeping missions, protect American lives and property, for humanitarian purposes, or to aid in nation building.
By custom and international law, a military incursion across national borders, without invitation or severe provocation, is an illegal act of war. Also, by both custom and international law, heads of state have a level of immunity not enjoyed by other citizens.
The Government of Panama did not invite the US to invade. Manuel Noriega was a head of state. Noriega had not committed any crimes within the borders of the US, though the crimes for which he was convicted were directed against the US.
Whether or not Noriega had committed crimes for which he deserved to be indicted and convicted, I thought then and still do that our invasion of Panama was illegal under custom and international law.