A bus passes the Flower Branch Apartments in Silver Spring, where an explosion and fire in August killed seven and left about 100 homeless. (Jabin Botsford/The Washington Post)

The Montgomery County Council unanimously approved legislation Tuesday to make a suburb that has been a bastion of homeownership more hospitable for residents who rent.

The bill, sponsored by council member Marc Elrich (D-At Large), would require annual county inspections of “problem” apartment buildings that generate numerous code violations. It also establishes a “repair and deduct” provision that under certain circumstances would allow tenants to fix problems and deduct the cost from their rent if landlords are slow to respond.

Landlords would have to offer tenants who renew their lease an option to stay for two years, and county housing officials would have to make apartment rents and other data they collect in an annual survey available to the public. The county’s housing director would report to the council each year on code citations issued and fines paid — broken out by specific landlords.

County Executive Isiah Leggett (D) is expected to sign the bill into law.

About one-third of Montgomery residents rent their housing, according to census data. Tenant advocates contend that while Montgomery’s renter population has grown, county policies until now have remained oriented toward homeowners and primarily have benefited landlords and property management companies whose campaign contributions afford them political clout.

The Elrich bill, co-sponsored by council members Nancy Navarro (D-Mid-County) and Tom Hucker (D-Eastern County), went through two years of committee hearings and behind-the-scenes negotiations with property owners and tenant groups.

Some of Elrich’s original provisions fell out of the final version, including one that would have barred landlords from adding rent surcharges if a tenant wanted to switch to a month-to-month lease. A proposal for a standard lease to be used in all rental properties was also eliminated.

Still, Elrich called it “a very good bill.”

Steve Silverman, a former council member and county economic development director who lobbied on behalf of major property owners affected by the bill, said the legislation offers “a fair and balanced approach.” His clients included including Bozzuto, Southern Management, Tower Cos. and Washington Property.

The bill does not provide renters with some of the major protections available elsewhere. The District, for example, has a strong rent-control law, while Montgomery County under this bill would continue to recommend an annual rent-increase limit that is strictly voluntary and often ignored by landlords.

There is also no specific protection for tenants against retaliatory evictions. Montgomery landlords can still decline to renew a lease without offering a specific, or legitimate, reason.

Matt Losak, executive director of the Montgomery County Renters Alliance, said that while he welcomes the bill, its provisions are “modest” compared with other jurisdictions where the cost of housing is rapidly escalating.

“It’s a good start,” Losak said. “But there is much work to be done.”

Council member Roger Berliner (D-Potomac-Bethesda) said he was drafting additional legislation that would move the county more toward the District model, where tenants can raise issues without fear of reprisal.

The District’s Office of the Tenant Advocate, for example, offers legal advice and can represent tenants in court. Montgomery’s Commission on Landlord-Tenant Affairs is more limited in its reach, providing information and adjudicating certain disputes, but not specifically advocating for tenants.

“Tenants do need more muscle behind them, and a safe place to go,” Berliner said.

Elrich’s bill gained momentum in the aftermath of August’s deadly explosion and fire at the Flower Branch Apartments in Silver Spring.

The disaster, which left seven dead, 39 injured and 63 families homeless, trained a spotlight on poor conditions at the 362-apartment community. Records showed frequent evidence of mice, roaches, mold from water damage and other substandard conditions.