Although people at the scene were able to quickly extinguish the fire, but the victim had suffered serious burns and was transferred to a hospital.
According to German police the man had purchased the gasoline at a gas station shortly before setting himself on fire. Adding that the asylum seeker was carrying a knife but did not use it.
The motives of the act remain unknown.
Germany has been the key destination for thousands of refugees and immigrants coming to Europe since the start of 2015. Last year, the country registered over a million asylum applications, according to the authorities.