"One of the bottles began to burn and a person who was in the building managed to extinguish the fire," said Peter Martin, a spokesperson at Skåne police, to news agency TT.
A window to the premises on Murmans Street was smashed and two bottles of flammable liquid were thrown in.
"It is very serious, given that someone tried to set fire to a building," said Peter Martin.
The cleaner who put out the fire did not have a phone and drove his car to alert a friend, who called emergency services. The man was later examined on site by paramedics. Police, who are treating the incident as arson, have carried out a forensic search of the premises.
The attack came on the eve of the release of a report about discrimination against Roma in Sweden.