The incident took place on Tuesday night at Yongah Hill centre north of Perth, government officials said.
"This person and two detention service providers who rendered assistance are receiving appropriate medical care," officials said in a statement.
The Afghan man, 40, sustained burns to 90% of his body, local media said.
Refugee advocates last month called for an inquiry into conditions at Yongah, after the death of a 27-year-old Afghan detainee who was attacked in a brawl at the centre.
The centre holds migrants seeking asylum and visa holders facing deportation for committing violent crimes.
Australia has adopted tough laws regarding people seeking asylum.
Anyone who arrives by boat is held on offshore detention centres in places such as Papua New Guinea and Nauru.
It also has a number of mainland detention centres, such as the one at Yongah Hill.
The man, who wrapped himself in a sheet and poured accelerant on himself, was flown to the Fiona Stanley Hospital in Perth, reported the West Australian newspaper.
A foreign detainee is reportedly in a critical condition after setting himself on fire at a detention centre in Western Australia.