WASHINGTON — House lawmakers Friday passed legislation to increase their office budgets for the first time in years but again deny themselves a pay raise of their own.

The additional money for staff salaries and other office expenses is aimed in large part at retaining staff aides, who are often 20-somethings who struggle to make ends meet in Washington, where rents have skyrocketed and opportunities outside of Congress often pay more than Capitol Hill jobs. It’s common for staff aides to get a little experience and move on.

“We are unable to pay young people that come here and keep them with their institutional memory,” said Rep. Alcee Hastings (D-Florida).

The increase in staff salaries is included in a $3.5 billion measure, which passed by a 233-175 vote, that would increase the budget for operations of the House of Representatives and supporting agencies such as the Library of Congress by 2 percent to $3.5 billion.

GOP leaders originally sought to maintain a freeze in office budgets, but the House Appropriations Committee last month approved an amendment by Sam Farr (D-California), to increase office budgets by $8 million, or 1.5 percent. The proposal passed the panel on a sweeping voice vote.

Lawmakers receive between $1.2 and $1.4 million to run their offices and travel back to their districts, depending on how far they live from Washington. Office budgets peaked in 2010, the last year of Democratic control of the House, at between $1.4 and $1.8 million.

While they are moving to increase staff pay, lawmakers also voted to deny themselves the cost-of-living pay raise they would otherwise automatically receive in January.

That means congressional salaries would be frozen at $174,000 a year. Lawmakers haven’t received a pay hike since January 2009.

The legislative operations funding measure is the second of the 12 annual spending bills to pass the GOP-controlled chamber, where a split between tea party lawmakers and House leaders over funding levels has meant delays and a controversy over a gay rights amendment by Democrats has scuttled one major bill. GOP leaders have since moved to block Democrats from again offering the LGBT measure, which is aimed at protecting lesbian, gay, bisexual, and transgender people from discrimination by federal contractors.

Most Democrats also opposed the legislative branch measure over a tea party-fueled provision urging the Library of Congress how to label immigrants living in the country illegally. The GOP move is designed to force the Library of Congress to retain the term “illegal alien” for cataloging and search purposes, reversing the library’s plan to replace “illegal alien” with less prejudicial terms like “noncitizens” or “unauthorized immigration.”

Conservatives were upset with the library’s change and urged bill author Tom Graves (R-Georgia) to reverse it. But Graves’ move whipped up opposition from Democrats who say it’s an unnecessary slap against immigrants.

“Although the term “alien” is used in our statutes, it is outdated and deeply insulting to people born abroad who have worked hard to contribute to our economy and communities,” said Rep. Zoe Lofgren (D-California), adding that the measure makes “Republicans in the House look like they are doubling down on vilifying immigrant communities.”