SAN FRANCISCO — The command from city officials to residents was simple: Put your clothes back on.

The San Francisco Board of Supervisors voted 6 to 5 on Tuesday to approve a ban on public nudity. The vote means that there will be no more lounging nude in the city’s plazas, parading up and down city streets sans pants or riding subways and buses bare-bottomed.

Scott Wiener, a city supervisor who represents the Castro district, introduced the ordinance after an increase in the number of habitual nudists and a rise in complaints from residents and business owners.

“The nudity situation in the Castro has become extreme,” Mr. Wiener told his colleagues.

After city supervisors approved the ban, the crowd at City Hall erupted in loud heckling and booing.

“Recall Wiener! Wiener is a Republican!” shouted Gerhart Clarke, 55, who stood up along with half a dozen others and stripped down to the buff.