MEXICO CITY  Every month, a wail of bagpipes reverberates through a plaza in downtown Mexico City, causing startled passersby to stop and stare. Then, from behind the bullet-scarred walls of an old fortress, a platoon of Mexican bagpipers emerges through the gates — paying tribute to an obscure but divisive chapter of history involving Mexico, Ireland and the United States. The ceremony honors the St. Patrick Battalion, a group of 600 Irish-American soldiers who switched sides to fight for Mexico in the 1846-1848 Mexican-American War. On St. Patrick's Day, many Mexicans will raise a glass to commemorate the "Irish martyrs" who are regarded as heroes in a war that still arouses passions here. "It's a little bit of a weird twist on history … and quite romantic for the Irish community," said Myles Doherty, the Irish consul in Mexico City. The battalion's story begins with Ireland's Potato Famine of the 1840s, which forced thousands of Irish to emigrate to the USA and other countries. In May 1846, the United States declared war on Mexico in a dispute over the boundaries of Texas. Many of the desperate Irish were recruited for the war, sometimes within days of landing in New York, said Carlos Mayer, a Mexico City historian and expert on the battalion. Most of the American commanders were Protestants, and they treated these Roman Catholic immigrants badly, Mayer said. Mexico offered land and higher wages to its recruits. As the fighting wore on, some of the U.S. recruits began to grow restless. "Many of them began to realize that Mexico was a fellow Catholic country that was being invaded and that was really defenseless in the face of the American military superiority," he said. "So they began switching sides." San Patricios The deserters became known as the San Patricios and were led by John Riley, an artilleryman who had fought in the British army. They were joined by a few Swiss, French, Scottish and German recruits, most of them also Catholic. Called los colorados, or "the redheads," by their Mexican comrades, they fought against the Americans at the key battles of Monterrey, Buena Vista and Cerro Gordo. The Americans eventually reached the outskirts of Mexico City on Aug. 20, 1847. Mexican forces, with the remaining San Patricios handling the artillery, pounded the Americans from a monastery-turned-fort on the Churubusco River until they ran out of ammunition. Thirty-five San Patricios died in the battle, 85 were captured, and another 85 retreated with the remnants of the Mexican army. On Sept. 13, 1847, the Americans seized Chapultepec Castle in the war's last major battle. San Patricios who had deserted before the war were branded by the Americans with the letter "D" on one cheek. The rest were hanged, including 30 who were executed at the foot of Chapultepec Hill. "They were hanged at the moment that the American flag was raised over the castle of Chapultepec, so that they would take that sight to hell with them," Mayer said. Mexico lost nearly half its territory as a result of the war, while the United States gained California and the Southwest. Even today, many Mexican school textbooks portray the war as an unjust land grab by the United States that led to the divergent economic paths followed by the two neighbors. Monthly commemoration The former monastery of Churubusco, where the San Patricios were defeated, is a national museum dedicated to the invasions Mexico has suffered. The bullet holes are still in the walls, and the cannons commanded by John Riley stand outside. Every first Sunday of the month, the St. Patrick Battalion Pipe Band plays in the soldiers' honor. On several weekends, an actor portraying Riley gives talks to schoolchildren and tourists. The battalion's name is written in gold letters in the chamber of Mexico's House of Representatives. The San Patricios were seen much differently in the USA, even by fellow Irish immigrants, said Ian McGowan, archivist at the Institute for Irish-American Studies at the City University of New York. "For a good 40 or 50 years, they were almost completely forgotten about," McGowan said. "The unofficial position of Irish who were looking to become Americans in the 19th century was not to discuss them." Recently, Americans have begun to pay more attention to the battalion. Several books have been written in the past decade and the 1999 movie One Man's Hero was about Riley. Bernard Brennan, an Irish-American tourist from San Francisco, said he learned about the battalion from a Mexican friend. On a recent afternoon, he snapped pictures of a carved stone plaque on the plaza where 16 of the Irish soldiers were hanged. "In memory of the Irish soldiers of the heroic St. Patrick Battalion, who gave their lives for the cause of Mexico during the unjust American invasion of 1847," the plaque says. Brennan said he doesn't see the soldiers as traitors. "As an Irish-American, I'm proud of them," he said. "Sometimes you have to stand up and say, 'What my country is doing is wrong.' I think they're heroes, heroes of conscience." Hawley is Latin America correspondent for USA TODAY and The Arizona Republic. Enlarge By Chris Hawley, USA TODAY Bagpipers play in honor of the St. Patrick Battalion at the former Churusbusco monastery in Mexico City. Conversation guidelines: USA TODAY welcomes your thoughts, stories and information related to this article. Please stay on topic and be respectful of others. Keep the conversation appropriate for interested readers across the map.