As both Irish and would-be Irish raise a glass to St. Paddy this weekend, perhaps it's time to recognize a slice of 19th-century lore that seldom makes it into U.S. history classes.

This heart-wrenching bit of Irish-Mexican history involves the St. Patrick's Battalion, also known as San Patricios. Positioned along Texas' southern border in the mid-1840s, during the infamous Mexican-American War, its roughly 200 members bade adios to Gen. Zachary Taylor's army and took up arms for their Catholic Mexican brothers.

They were among about 9,000 U.S. soldiers to desert during the 1846-48 conflict, from which the United States gained half of Mexico's territory.

They were called traitors by American war hawks of the time, but heroes by most of Mexico. Even today, Mexicans toast their feats on March 17, St. Patrick's Day, and on Sept. 12, marking the anniversary on which many were hanged in 1847.

The San Patricios was an artillery unit, wrote historian Michael Hogan, author of "The Irish Soldiers of Mexico." They included Germans, Scots and others, mainly conscripted immediately after immigrating. They opposed fighting fellow Catholics and had yet to establish a solid U.S. allegiance. Fueling their discontent were fierce anti-Catholic prejudice within the Army's ranks and the fact that they weren't given citizenship, as they'd been promised.

The Mexican-American War was unpopular throughout the young nation. After Mexico rejected President James Polk's offers to purchase what is now the U.S. Southwest, Polk plotted incidents to justify an all-out attack on an impoverished nation.

Congressman Abraham Lincoln opposed the war, as did Henry David Thoreau and Ralph Waldo Emerson. Thoreau wrote his famous essay "Civil Disobedience" about that time.

"The United States invaded another country," Hogan said. "Mexico was a republic that outlawed slavery in 1810 and we were still a slave nation."

Stationed in Brownsville, Capt. John Riley and a handful of enlisted men formed what became the San Patricio Battalion, picking up more followers after U.S. cannons were aimed at a cathedral in Monterrey. Mexico's soldiers welcomed them. Gen. Santa Anna regarded the Irish as among his best troops.

"The San Patricios were honest men who did not like the way they were treated," Joan Moody, of the Harp and Shamrock Society of Texas, told San Antonio's Express-News.

Mexico is speckled with schools, churches and streets bearing the battalion's name. Both there and in Ireland, postage stamps pay tribute to it. In Riley's native County Galway, there's an annual ceremony.

In another little-told chapter, many deserters of the Mexican-American War were pardoned, Hogan recounts. The Irish were the only deserters executed — not by firing squad, under military law, but by hanging.

A few years ago, their story resurfaced in a CD by the Chieftains titled "San Patricio." National Public Radio described it as "an unusual musical mash-up" that fuses a traditional Irish sound with a variety of artists, mainly Hispanic.

Among them were Linda Ronstadt, Lila Downs, David Hidalgo and Cesar Rosas of Los Lobos, Los Tigres del Norte and the legendary Chavela Vargas. Grammy-winner Ry Cooder took a lead role in the 19-song project, and actor Liam Neeson narrated the poem written by Chieftains frontman Paddy Moloney:

"We are the San Patricios, a brave and gallant band

"There'll be no white flag flying within this green command

"We are the San Patricios, we have but one demand

"To see the Yankees safely home across the Rio Grande."