SAN FRANCISCO (CBS SF) – The San Francisco Board of Supervisors gave final approval Tuesday to legislation that bans people from visiting the city’s parks during the overnight hours.

The board voted 6-5 in favor of closing parks between midnight and 5 a.m. after giving initial approval by the same vote two weeks ago.

Supervisor Scott Wiener proposed the ban as an attempt to prevent illicit activity like vandalism and illegal dumping in the city’s parks.

Those problems cost San Francisco more than $900,000 each year, according to the city’s Recreation and Parks Department.

However, homeless rights advocates said the legislation will primarily affect homeless people who sleep in sites like Golden Gate Park overnight.

Violators will face a fine of up to $100 for a first offense, with escalating fines and a possible misdemeanor conviction for subsequent offenses.

Open space plazas like Union Square and Civic Center Plaza are exempt under the legislation.

The ban was opposed by Supervisors John Avalos, London Breed, David Campos, Jane Kim and Eric Mar.

The legislation will now go to Mayor Ed Lee, who will decide whether to sign it into law.

(Copyright 2013 by CBS San Francisco and Bay City News Service. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.)