WASHINGTON — The Senate narrowly confirmed Beaumont lawyer Michael Truncale for a lifetime judgeship in East Texas on Tuesday, with Utah Sen. Mitt Romney breaking ranks because the nominee had called Barack Obama an “un-American impostor.”

Obama was president at the time.

Truncale made the comment during a speech to a women’s group in Beaumont in June 2011, two months before he launched an unsuccessful campaign for Congress.

"He made particularly disparaging comments about President Obama. And as the Republican nominee for president, I just couldn't subscribe to that in a federal judge," Romney said Tuesday. "This was not a matter of qualifications or politics. This was something specifically to that issue as a former nominee of our party."

Romney ran against Obama as the GOP nominee for president in 2012.

Sens. Ted Cruz and John Cornyn recommended Truncale to President Donald Trump and praised his confirmation, which came on a 49-46 vote. Romney was the only Republican who voted no.

In written comments to the Senate Judiciary Committee, Truncale defended his 2011 remark, saying he was “merely expressing frustration by what I perceived as a lack of overt patriotism on behalf of President Obama.”

The liberal Alliance for Justice and Planned Parenthood, which supports abortion rights, opposed Truncale, citing concerns about his views on immigration, human rights and reproductive rights.

“The Senate is continuing to deliver on its promise to the American people to confirm principled, constitutionalist judges,” Cruz said in a statement.

Trump nominated Truncale in January 2018.

Just before his confirmation hearing that April, Slate reported that during his 2012 congressional race, he called undocumented immigrants “maggots,” though it quickly backed off that claim, which seemed to stem from a mishearing of his Texas accent. In fact, Truncale had referred to entitlement programs as “magnets” that lure migrants to the U.S.

Truncale lost the 2012 Republican primary. Rep. Randy Weber, R-Friendswood, beat him and went on to succeed Ron Paul, who had retired.