Oregon is poised to become the first state in the nation to impose statewide limits on how much landlords can raise rents after state lawmakers passed a sweeping measure on Tuesday.

The legislation would generally limit rent increases to 7 percent annually plus the change in the Consumer Price Index, a measure of inflation. Some smaller and newer apartment buildings would be exempt.

The Democrat-controlled House of Representatives passed the bill by a vote of 35 to 25, largely along party lines. It had already been approved by the State Senate, and Gov. Kate Brown, a Democrat, plans to sign the bill, a spokeswoman said Tuesday.

The measure’s passage comes as states and cities across the country have struggled to address a growing housing affordability crisis. Rents have risen while wages have stagnated, and the supply of affordable housing has fallen short of need.