U.S. Rep. Joaquin Castro on Thursday lost his battle with Congressional Republicans who want the U.S. Library of Congress to continue using controversial immigration terms in its search headings.

The library announced in March that it planned to eliminate the terms “illegal aliens” and “alien” and instead use the terms “noncitizens” and “unauthorized immigration” when making references to subjects dealing with undocumented immigrants.

But Republicans included language in a pending budget bill that would block the library from making the switch, mandating that it use the same terms currently used in federal law.

Castro, D-San Antonio, countered by calling for a floor vote on legislation he authored that would replace the terms “alien” and “illegal alien” in federal law with “foreign national” and “undocumented foreign national.” The vote failed, 231 to 170.

The Texas Tribune thanks its sponsors. Become one.

The terms have been a source of debate for years, with immigrant rights groups saying they are demeaning and inaccurate. Castro said in a floor speech the terms were “prejudicial” and “offensive to Hispanics.” 

“House Republicans are trying to force the most prestigious library in our nation to use the offensive, divisive language of their candidate for President, Donald Trump,” Castro said. “This effort is proof that his ugly rhetoric is permeating the party he leads.”

Castro also tried late Wednesday to offer two amendments to the budget bill that would allow the library to change the terms, but the House Committee on Rules rejected his motion.

Thursday’s vote didn’t come as a surprise as Republicans had previously expressed their disapproval with the library’s planned changes. In May, U.S. Reps. Lamar Smith of San Antonio and John Culberson of Houston joined U.S. Sen. Ted Cruz in telling acting librarian David S. Mao the library was yielding "to the political pressure of the moment.”

“Such an action is beneath the dignity of the Library of Congress," they wrote Mao in a letter dated May 19. “Rather than engage in revisionist history, the Library should base its decisions on sound judgment, taking actual history, present facts, and future research efforts into account.”

Castro also noted the GOP is strong-arming an institution that is usually left alone when it determines what changes to make to its catalogue. In 2015, he noted, the library made 4,934 changes.

The Texas Tribune thanks its sponsors. Become one.

Castro will keep trying to convince his colleagues to vote against the appropriations on Friday, and he expressed confidence that the language will eventually disappear from common use. 

"I think this term will be taken out of both federal code and the Library of Congress eventually, whether it’s six months from now, five years from now or 15 years from now," he said after Thursday's vote. The House is expected to take a final vote on the budget bill tomorrow.

Abby Livingston contributed to this report.

Never miss a moment in Texas politics with our daily newsletter.