SAN FRANCISCO (CBS SF) — The San Francisco Board of Supervisors unanimously approved legislation making it the city the first in the nation to prohibit city contracts with and purchases from companies in states that sanction discrimination against the lesbian, gay, bisexual and transgender community.

The legislation, introduced by Supervisor Scott Wiener, also bans official city travel to such states.

READ MORE: UPDATE: Evacuations Ordered After Wildland Fire Erupts Near Santa Cruz County Prescribed Burn

“Today San Francisco took a strong stand against anti-LGBT hate laws in our country,” Wiener said in a statement. “I’m proud that our city is stepping out and being a leader in this fight.”

The legislation was inspired by laws passed in April in Mississippi and in North Carolina and codified moves made by Mayor Ed Lee to prohibit city travel to those states.

READ MORE: COVID: Bay Area Airports, Tourism Industry Gears Up As Rules Loosen For International Travelers

The Mississippi legislation provided legal protection for discrimination on the basis of sexual or gender orientation or marital status. In North Carolina, state legislation prohibited local governments from passing anti-discrimination laws and required transgender people to use the restroom indicated by the gender on their birth certificate.

The ordinance allows city departments to appeal the ban in limited cases, including for public health and emergency crises, if there is only one source providing the service or item required.

MORE NEWS: San Jose Set to Impose Steep Penalty for Residential Water Overuse

TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. Bay City News Service contributed to this report.