The object was found shortly after 10:30 a.m. inside a portable toilet on a sidewalk in front of a home in the 2100 block of Scott Street where construction is under way, police said.
It turned out to be a container filled with flammable liquid, and police are now investigating the incident as a case of attempted arson of the portable toilet, police spokesman Officer Albie Esparza said.
Shortly after 1:30 p.m., police began leaving the scene and streets in the neighborhood were reopening after the bomb squad determined there was no risk to the public.
The discovery initially prompted police to evacuate some homes and instruct other neighbors to shelter in place.
Scott Street was blocked off between Washington and Sacramento streets, and Clay Street was shut down between Pierce and Divisadero streets.
Esparza said there is no immediate indication that the arson attempt is connected to any previous incidents in which portable toilets were lit on fire.
Anyone with information about the case is asked to call the Police Department's anonymous tip line at (415) 575-4444 or send a tip by text message to TIP411 with "SFPD" in the message.