The ordinance, which the City Council officially passed in a 5-4 vote on Tuesday, will take effect July 29 and "education, outreach and enforcement will begin immediately thereafter, according to a news release.
The ordinance bans tent encampments at all times in certain sensitive areas -- parks, canyons and near schools, transit stations and homeless shelters -- regardless of shelter capacity.
After a lengthy and, at times, emotional public hearing, the City Council on June 13 voted 5-4 to advance the policy.
Gloria said that city leaders have a "duty to find solutions that strike a balance between supporting the most vulnerable among us and getting them the care they need and maintaining the safety and quality of life for all residents."
"This Unsafe Camping Ordinance strikes that appropriate and necessary balance, and it's why I have signed it into law," Gloria said. "I'm grateful to Councilmember Stephen Whitburn for his leadership on this issue."
Gloria and Whitburn were strong advocates of the policy, which some opponents say criminalizes homelessness or won't solve the greater causes of the social problem.
Whitburn said he thanked Gloria for "swiftly signing this common-sense ordinance into law."
"Today, our neighborhoods are another step closer to becoming safer and healthier," Whitburn said. "San Diego is taking the lead in enacting reasonable regulations that will move people out of encampments and into shelter and housing."