The man was in a room at the Migration Board (Migrationsverket) with two border police officers. He had just been informed that his bid for asylum in Sweden had been rejected and he would have to leave the country.
Upon hearing the news, the man doused himself in a flammable liquid and set himself alight, prompting the officers to call for backup.
In the meantime, however, the officers in the room found a fire extinguisher and were able to put out the flames.
The man was taken by ambulance to Karlstad's Central Hospital where he was treated for "non-life threatening" injuries, a Migration Board spokesperson told the local Nya Vermlands Tidningen (NWT) newspaper. The officers were also treated for minor burns.
Police are treating the incident as a case of attempted arson. It is the second time in recent months that a person has attempted to set themselves on fire in the Karlstad Migration Board offices. In late October, an 18-year-old man tried to set himself alight but was stopped before he caught fire.
He was later sentenced to nine months in prison for attempted arson.