SACRAMENTO, Calif. — California lawmakers have sent the governor legislation capping rent increases as the nation's most populous state struggles with an affordable housing and homelessness crisis.

Assembly members on Wednesday voted 46-22 to limit annual rent increases to 5 percent plus inflation.

The cap expires in 2030. It wouldn't apply to housing built within the last 15 years or to single-family homes unless they're owned by corporations or trusts.

Also exempt are duplexes where the owner lives in one unit.

Gov. Gavin Newsom calls it "the strongest package in America."

Democrats posed the vote as a moral imperative to counter rent gouging and keep the poor and elderly in their homes.

Republicans countered that Democrats who control California's government created the problem by passing restrictive development and environmental laws.

RELATED: 

WATCH ALSO: Why is gas cheaper in Sacramento County compared to Placer County? | Why Guy