Gov. Charlie Baker signed a housing security bill on Monday to put a pause on evictions and foreclosures until after the coronavirus pandemic abates, finalizing an effort that took weeks for the Legislature to negotiate.

House and Senate Democrats signaled their interest in late March in protecting renters and homeowners during the crisis and the Legislature passed the bill (H 4647) on Friday after House and Senate negotiators reached a compromise, and Republican Rep. Shawn Dooley agreed to stand down after blocking the bill's passage for a day due concerns about impacts on landlords.

Baker signed the bill at 3 p.m. despite realtors urging the governor to return it to the Legislature with an amendment.

The Greater Boston Real Estate Board wanted Baker to propose an amendment to remove a temporary ban on landlords issuing notices to quit, which board CEO Gregory Vasil called "a key part of, but preliminary, any legal action." Housing advocates wanted the ban because they said renters receiving such a notice may feel pressured to leave, and put their own health at risk to do so. Vasil suggested adding language to the notices that would clearly inform renters of their right to stay in the property.

The moratorium will last for 120 days, or until 45 days after Baker lifts the COVID-19 state of emergency. The bill does not absolve tenants or homeowners from paying their rents or mortgages, but does protect them from paying late penalties as long as they demonstrate that their inability to pay during the crisis is due to a hardship caused by the pandemic.

"This legislation is crucial for public health," said Andrea Park, attorney at Massachusetts Law Reform Institute. "If we are going to stay home to prevent the spread of the coronavirus, we must all have a home to stay in. The strong moratorium passed by the Legislature and signed by the Governor will help ensure that evictions and foreclosure do not force people into unsafe situations."

The Greater Boston Interfaith Organization also thanked Baker for "taking swift action," stating that the bill will "provide much needed relief to families throughout the Commonwealth, especially low-income families."