San Francisco has a reputation as one of the prettiest cities in the world, but a survey of more than 150 downtown blocks has revealed streets covered with garbage, human excrement and hypodermic needles across the liberal city.

In all, the survey by NBC Bay Area took in 153 blocks -- an area that includes City Hall and several schools.

"The investigation revealed trash littered across every block," the station reported. "The survey also found 41 blocks dotted with needles and 96 blocks sullied with piles of feces."

FLASHBACK: SAN FRANCISCO GRAPPLES WITH CRIME, BLIGHT AFTER YEARS OF LIBERAL POLICIES

The survey results led a University of California, Berkeley infectious disease expert to compare downtown San Francisco to slums in developing countries.

"The contamination is … much greater than communities in Brazil or Kenya or India," Dr. Lee Riley told the station. Riley added that discarded needles could cause HIV and Hepatitis B and C, while dried feces can cause potentially dangerous viruses.

In December 2016, Fox News reported that San Francisco was at or near the top of national surveys tracking homelessness, with the city's high cost of living accentuating a gap between the haves and have-nots. Earlier that year, the FBI reported that the city had the highest rate of property crime in the nation.

That didn't stop the editors of Conde Nast Traveler from naming "The City by the Bay" one of its 50 most beautiful cities in January 2017.

"The adventurous spirit that made San Francisco what it is today thrives in the new restaurants, cafes, shops, and galleries sprinkled throughout what is arguably the most beautiful city in the U.S," the editors wrote.

Click for more from NBC Bay Area.