Las Vegas officials passed a law on Wednesday the first in the US that will make it illegal for homeless people to sleep on streets when beds are available at established shelters.

The measure will apply to the city's downtown urban core, not the tourist-heavy Las Vegas Strip, which is overseen by a different jurisdiction.

Las Vegas becomes the latest city in the US West - from San Francisco and Seattle to Honolulu and Salt Lake City - to try to deal with complaints about homelessness.

This image shows a homeless camp in Las Vegas on Las Vegas Boulevard North near Foremaster Lane. City officials introduced a law on Wednesday that will make this type of camping illegal on the streets of the city

The 9th US Circuit Court of Appeals struck down a similar law from Boise, Idaho, last year - calling it unconstitutional to prosecute people for sleeping in public places when there aren't enough shelter beds.

City Attorney Brad Jerbic said the Las Vegas law was crafted to withstand a similar legal challenge, with its 'if beds are available' provision.

Opponents rejected city officials' assurances that there will be enough shelter space when necessary.

Las Vegas is one of many cities in the US with a large homeless population due to a perfect storm of high addiction rates, expensive housing, job losses and a lack of mental health service infrastructure.

Mayor Carolyn Goodman, the sponsor of the measure, called it imperfect but necessary to deal with what officials and downtown business owners characterize as a homeless crisis.

Las Vegas Mayor Carolyn Goodman points toward protesters during the council meeting where the city council issued a ban on homeless camping on Wednesday

Sitting on an installation on the downtown sidewalk, Sebastian Bach, 62, has been homeless and living in the arts district for a year and a half in Las Vegas, NV, pictured on February 20, 2016. The ruling will not extend to the tourist heavy Las Vegas strip as it is managed by a different jurisdiction

'This is flawed but it is a start,' the mayor said after noting Las Vegas' economy relies on its image as an attractive international tourist attraction.

'We have been having these conversations for 20 years,' she said, 'and we must have results.'

The issue spurred emotion and drama, including the ejection by city marshals of several audience members who Goodman deemed disruptive during a daylong City Council meeting that drew dozens of time-limited comments.

Most people spoke against the law before the 5-2 council vote.

In this October 15 photograph, patrons of The Salvation Army homeless shelter grab supplies near downtown Las Vegas. The new ruling will mean that if a bed is available at a shelter like the one pictured, homeless people will be fined or imprisoned for staying on the streets

The camping ban proposal drew opposition from Democratic presidential candidates Joe Biden (2R), Elizabeth Warren (right), Bernie Sanders (3R), Kamala Harris (4R), Cory Booker (3L), Tom Steyer (2L) and Julian Castro (not pictured)

The law provides for warnings by public officers, beginning Sunday, for people found 'camping, lodging, sitting, lying down, sleeping and similar activities' in most downtown areas.

Those activities become a misdemeanor beginning 1 January, punishable by up to six months in jail and a $1,000 fine.

'It's criminalizing the homeless,' the Rev. Leonard Jackson, associate pastor of First African Methodist Episcopal Church in North Las Vegas and director of the regional Faith Organizing Alliance said during a morning protest outside City Hall.

About 100 people rallied, chanting, 'The war on the poor has got to go,' before taking their protest into the contentious public meeting that lasted more than nine hours.

'If we can build stadiums, then we can build housing for the homeless,' George Allen, a self-described 'working homeless' home-care worker, told the council.

Allen was referring to a $2 billion, 65,000-seat football stadium set to open next year for the relocated Oakland Raiders. Taxpayers are contributing $750 million to the project through hotel room taxes.

City officials report spending more than $35 million on homeless-related services last year, including outreach, fire, police and community services.

The camping ban proposal drew opposition from Democratic presidential candidates Joe Biden, Elizabeth Warren, Bernie Sanders, Kamala Harris, Cory Booker, Tom Steyer and Julian Castro.

In this file photo from July this year, a homeless man moves his belongings from a street near Los Angeles City Hall, background, as crews prepared to clean the area. Los Angeles is also planning to ban homeless people from sleeping on the city's sidewalks

A homeless camp at Market Street and 5th Street is photographed on Thursday, May 18, 2017, in Oakland, Calif. San Francisco's attempts to criminalize homelessness have been halted after the 9th US Circuit Court of Appeals deemed it unconstitutional to prosecute rough sleepers for sleeping on the sidewalk when there is no alternative

Castro, a former US Housing and Urban Development secretary, attended a 2 October protest against the proposed ordinance.

Michael McDonald, head of the Nevada Republican Party, accused the Democrats of 'pandering to Las Vegans' and 'advocating for the homeless to continue suffering on our streets.'

He noted the proposal requires warnings and offering transportation to a shelter with an available bed before a person would get cited.

An annual survey taken one night in January counted more than 5,500 people on the streets in Las Vegas and surrounding cities and county property. Officials estimate that more than 14,000 people are homeless in and around Las Vegas at some point during the year.

The Review-Journal has tallied about 2,000 beds plus an open-air, 24/7 courtyard offered by the city where officials say more than 300 people stay on any given night. It has 220 sleeping mats.