The 13-unit apartment building on Rainier Avenue in south Seattle had heaters that would not heat and mold that creeped along the walls. Some of the windows were broken, and the tenants lived with roaches. It was the kind of place where you might make do if you had few better options and the rent were really cheap.

But then in the fall, the tenants received notice their rent was going up — in some cases doubling, to more than $1,000 a month.

"The question that came up when we were talking to the tenants was 'how can this even be legal?' " says Kshama Sawant, the lone socialist on Seattle's city council. After the tenants complained to her office — prompting a media tour  and public outrage — the city's code inspection department found dozens of violations at the property.

"How can it be legal for a landlord to increase your rent while there are reported outstanding housing code violations?" Sawant continues. "It seemed like that just should be straight-up illegal. Then we found, no it’s actually perfectly legal."

Earlier this month, Seattle's city council passed a bill, popularly named after Carl Haglund, the owner of that property, that now forbids landlords from raising the rent on properties that violate the city's core standards for livability. Landlords have warned that the law is a form of rent control, which state law in Washington prohibits. And tenant groups have celebrated it as a major victory in a city where rents are rapidly rising.

The novel idea, though, likely won't restrain rising rents. Rather, it will achieve something that is equally elusive in many major cities: It will force more landlords to fix up neglected properties.

"From our perspective, this is not about controlling rent," says Faith Lumsden, the director of code compliance in the Seattle Department of Construction and Inspections. "But boy oh boy, we finally found a way to connect the key minimum standards of our housing code to the heart of that property owner’s business enterprise."

Under the new law, her department now has the legal power to block landlords from raising rents until they fix major property problems (a chipped sink doesn't count; a sink that spurts only cold water does). That's arguably a sharper stick than the threat of fines, for which the city has to go to court. And the new law incentivizes tenants to report problems, which is an essential part of enforcing violations in a department that heavily depends on complaints.

"Tenants who either feared calling government or just had kind of an unwritten agreement with the landlord that they wouldn’t complain as long as the rent didn’t go up — they don’t call us," Lumsden says. That's one of her department's biggest problems.

Now more will, provoking inspections. And now landlords have a greater incentive to act quickly. The law essentially turns Seattle's rising rents into a broad trigger for building compliance. The concept won't work everywhere, but where rents are escalating and cities count on complaints, Lumsden suggests this is smart policy for other cities, too.

"Our approach leaves the timing of a rent increase and the amount of a rent increase completely up to the property owner," she says. And that may be crucial for avoiding a legal challenge under the state's rent control ban. "All we’re asking is that they be ready to verify that they meet the code, or fix something, or the rent can't go up."

While the city council was debating the law, landlords argued that they sometimes need rent increases to cover repairs. Tenant advocates, in turn, scoffed at the suggestion that renters should be on the hook to pay for fixing code violations. The new law, after all, requires property owners to address problems that were illegal anyway.

"That shows it is not enough to pass laws," Sawant says. "This is a question not so much of legality as it is of power. Who has the power? Is it landlords and big real estate associations and realtors and Wall Street, because Wall Street speculation is also creeping into the city? Or do tenants and ordinary households have the power?"

In general, rent regulations are as much about the economics of housing between renters and landlords as the balance of power between them. This law also addresses what seemed fundamentally irrational to the Rainier Avenue tenants: The cost of their housing was going up as the quality of it went down. That's not how many other markets work.