Berkeley became the second city in California to prohibit landlords of most rental properties from asking potential tenants about their criminal histories and conducting criminal background checks.

City officials said the ordinance, adopted late Tuesday night, is meant to eliminate housing barriers for formerly incarcerated people looking to find a place to rent.

“I really see this as not only a moral issue but as a key homelessness issue,” said Berkeley Mayor Jesse Arreguín. “So many people on our streets are not able to access housing because of a criminal record.”

Landlords are prohibited from asking prospective renters about their criminal histories and are unable to take “adverse action” against a housing applicant based on their history.

The ordinance will not apply to permitted accessory dwelling units, single-family homes, duplexes and triplexes. It also won’t apply to property owners who rent their homes when they are on sabbatical or if they are renting a room in the property they live in.

Landlords are permitted to check whether a rental housing applicant is on the registry for lifetime sex offenders. Landlords of housing funded by the Department of Housing and Urban Development will have a partial exemption from the ordinance as long as they operate under federal regulations, which do not allow housing for tenants on the lifetime sex offender registry and people who cooked methamphetamine on a federally assisted housing property.

Landlords will still be permitted to review a potential tenant’s references, employment, income status and credit reports. Tenants can pursue legal action or file a complaint with the city if they feel discriminated against under the ordinance.

Berkeley is the second city in the state to pass such sweeping legislation. The council passed the legislation in a unanimous vote. In January, the Oakland City Council voted unanimously to pass similar legislation.

Berkeley has 1,108 homeless people in its city. Studies show that formerly incarcerated people are almost 10 times more likely to experience homelessness than the general public due to housing insecurities. In Berkeley, 10% of the homeless population is formerly incarcerated, according to the city’s point-in-time count taken in January. Five percent of those surveyed are currently on probation, according to the data.

San Francisco and Richmond have similar but more narrowly focused laws. In San Francisco, the law applies only to affordable housing, and in Richmond it applies to all publicly subsidized affordable housing and nonprofit housing.

Berkeley’s ordinance, the Ronald V. Dellums Fair Chance Access to Housing Ordinance, will apply to public housing, nonprofit housing and private rentals.

Krista Gulbransen, the executive director of the Berkeley Property Owners Association, which represents 800 owners, spoke in support of the ordinance.

“We as an industry recognize the inequities in our justice system, we recognize the impact on our communities of color,” she said. “I’m going to cry because this is the first time I’ve been able to come forward and support something instead of fighting it.”

At the meeting, Councilwoman Kate Harrison acknowledged critics of the ordinance.

“You don’t know who is in the building next to you and you don’t know who is walking in your parking lot and you don’t know who is in your church,” Harrison said. “We have to give people a chance.”

Nearly a dozen people spoke during public comment — most of whom were in support of the ordinance. Only one woman expressed concern, particularly for victims of crimes involving sexual violence.

“It’s also difficult for survivors of those crimes to get housing where they feel safe,” she said.

John Jones III, campaign director for Alameda County Fair Chance to Housing Coalition, spoke during public comment. He was involved in developing the ordinance in Berkeley and Oakland.

“We want to be a part of this community,” said Jones, who formerly was incarcerated. “That is why it is called a fair chance, because we are just asking for a fair chance.”

Councilwoman Lori Droste said at the meeting that Berkeley property owners were involved in developing the ordinance and that involvement was “critical” in reaching consensus among different groups.

Sarah Ravani is a San Francisco Chronicle staff writer. Email: sravani@sfchronicle.com Twitter: @SarRavani