State lawmakers announced Tuesday evening an agreement that is meant to permanently extend rent control laws for New York and expand the regulations to upstate communities.

The agreement, while not as ambitious as lawmakers’ public positions, still went further than previous rent control agreements struck in the recent past under Republican control of the state Senate, and the details were praised by housing advocates.

The deal would allow local governments outside of the New York City metropolitan area to opt in for rent regulations for municipalities that have a less than 5 percent vacancy rate in the housing stock to be regulated. Opting in would allow the locality to set up its own rent stabilization board.

Statewide, the agreement also bans the use of “tenant blacklists” and limits security deposits to one month’s rent, while also requiring procedures that lead to the prompt return of the deposit.

New protections would be added to tenants during an eviction process swell, while also barring landlords from forcing a tenant eviction.

Landlords would also be required to give tenant notices if they plan to increase rent more than 5 percent or do not intend to renew their lease.

“These reforms give New Yorkers the strongest tenant protections in history,” Assembly Speaker Carl Heastie and Senate Majority Leader Andrea Stewart-Cousins said in a joint statement issued alongside the top-line details of the deal.

“For too long, power has been tilted in favor of landlords and these measures finally restore equity and extend protections to tenants across the state. These reforms will pass both legislative houses and we are hopeful that the Governor will sign them into law. It is the right thing to do.”

The deal was struck as Gov. Andrew Cuomo had sought to apply outside pressure on lawmakers to act, pledging to pass anything the Legislature put in front of him. Cuomo doubted whether the state Senate, under control of Democrats for the first time in a decade, could muster the needed votes to pass a robust rent package.

“I think they can only pass a modified version of what the Assembly has proposed,” Cuomo said of the state Senate in a radio interview.

But advocates on Tuesday evening were praising the agreement — something the Legislature was quick to point out when announcing the agreement.

“This bill is affirmation of the Statewide movement that we are building together, and we look forward to working with the Senate and the Assembly, in the years to come, until every renter, from Brooklyn to Buffalo, can live free from the fear of displacement,” said Cea Weaver, the campaign director of the Upstate Downstate Housing Alliance.

Affordable housing advocates had closely watched the negotiations surrounding rent control this year following the transfer of power in the Senate, hopeful a stronger package of bills would approved compared with the measures four years ago.

“This past election ignited the fires of change as evidenced by today’s tenant protection package,” said Rosemary Rivera of Citizen Action. “The Senate and Assembly have listened to the needs of tenants across the state and put forth bold legislation to end the housing crisis, showing how ordinary people, when organized, can beat back the billionaire real estate giants.”

The bill could be voted on as early as Friday, ahead of Saturday’s deadline for the rent laws to expire.