(CNN) In an attempt to get homeless people off city streets, the Las Vegas City Council has passed an ordinance that makes it a crime to camp or sleep on a city sidewalk.

Supporters of the ordinance, which passed 5-2 on Wednesday, say it's an attempt to push the more than 6,500 homeless people and families in southern Nevada into homeless shelters while also protecting the health and safety of the community.

The city council said Las Vegas has committed $16 million to the Courtyard Homeless Resource Center , which provides housing and a range of other services to address chronic homelessness.

"The city believes the ordinance will be a benefit to the homeless population, while at the same time protecting the health and safety of the entire community," Mayor Caroyln G. Goodman said on Twitter . "The city has always demonstrated compassion for the needs of the growing homeless population, understanding the public safety of everyone is a top priority."

But opponents said the law just makes it more difficult for homeless people to get back on their feet. Protesters at the city council hearing chanted "housing not handcuffs," CNN affiliate KSNV reported

Read More