OAKLAND — The Oakland City Council on Thursday approved an emergency ordinance barring landlords who live in their duplexes and triplexes from raising their tenants’ rents more than 3.4 percent in the next six months.

The moratorium, passed on a 6-0 vote at a special meeting, goes into effect immediately. Council members Larry Reid and Loren Taylor did not attend the meeting.

The 3.4 percent figure is tied to the annual Consumer Price Index increase permitted under the city’s rent control ordinance.

Council members Nikki Fortunato Bas and Lynette Gibson McElhaney introduced the ordinance in an effort to temporarily thwart rent increases while the City Council drafts a permanent ordinance to scrap an exemption to the city’s rent control and tenant protection laws for owner-occupied duplexes and triplexes.

Tenants’ rights activists showed up at Thursday’s meeting to support the moratorium and proposed removal of the owner-occupied exemption.

“Longtime Oakland residents keep being displaced because of this loophole,” attorney Jackie Zaneri told the council. “A tenant deserves the right to stability in their home, to know what the rent is going to be from one month to the next, one year to the next.”

Landlords also showed up to denounce the moratorium and proposed ordinance change. Many said it’s unfair to small-time landlords who rely on the income generated by their extra units.

Nick Farmer said he bought a “fixer-upper” a few years ago to live in and is building a new unit on the property to rent out for some extra income. He said he wants to help address Oakland’s housing shortage but feels he is being made a villain.

“If I am going to be able to repay the loans I took out to do this, I’m going to need the ability to charge a fair income, so what’s going to happen now is I will be incentivized to rent it as high possible,” Farmer said. “I don’t want to have to do that, I want to make a deal that’s fair, but I need to be flexible.”