The man died on Thursday afternoon at the University Hospital Zurich, reported news agencies on Friday.
The Tunisian, who was reportedly in Switzerland illegally and under threat of deportation, poured petrol over himself at a gas station on Wednesday afternoon, said Glarus police.
He then moved away from the petrol station towards a bus stop, where he doused himself again and then used a lighter to set himself on fire.
Two passers-by managed to put out the flames using a fire extinguisher from the petrol station and blankets.
The victim was transported by emergency Rega helicopter to University Hospital Zurich.
No one else was injured in the tragic incident.