In Mexico city there's a Park not far from where I lived there, that is named after the St Patrick's Battalion that was led by General John Riley. Most in the battalion was composed of Irish immigrants to the USA and other Europeans from Germany, Italy and more and were ordered to join the US Army to invade Mexico in 1846.
However John and the rest in his battalion were taken aback by the abuses of rape and theft the US Army was conducting against the Mexican population during the invasion, and the Irish being Catholic like the Mexicans and having suffered from British invasion in their own Ireland back home, decided to change bands and all together left the US Army and joined the Mexican side.
Unfortunately the Mexicans initially were deeply suspicious of the Irish who specialized in artillery, but eventually accepted them and were of great help to the Mexican army.
However the US did take Mexico city and stole more than half the Mexican territory, capturing the Irish and making an example by punishing them with particular cruelty, hanging most of them but not before they watched the US flag being flown from the Mexican garrison.
The Saint Patrick's Battalion was a unit of 175 to several hundred immigrants and expatriates of European descent who fought as part of the Mexican Army against the United States in the Mexican–American War of 1846–48.
Formed and led by John Riley, the battalion's members included many who had deserted or defected from the United States Army. The battalion served as an artillery unit for much of the war.
Despite later being formally designated as two infantry companies, it retained artillery pieces throughout the conflict.
The San Patricios were responsible for the toughest battles encountered by the United States in its invasion of Mexico, with Ulysses S. Grant remarking that "Churubusco proved to be about the severest battle fought in the valley of Mexico".