"This is a very important and human and reasonable solution to a very difficult situation in Swedish schools today," said Johanna Jaara Åstrand, president of the National Teaching Union.
"The last couple of years, the Swedish schools have accommodated tens of thousands of new students that have come to us as refugees. Up until now, the 18th birthday has been the end of education for a lot of children, if they have not been granted permanent residency, and that has led to a lot of stress for students, and for their teachers and classmates," she said.
All the uncertainties that the students have felt over what will happen to them, once they turn 18 have affected a teachers' ability to do a good job, according to Jaara Åstrand.
"The decision in the Swedish parliament will bring peace to the work in the schools, and make it possible for students to finish their degree, and for teachers to teach," she told Radio Sweden.
The law will be applied from the 1st of June this year, and will contain a condition for asylum seekers – residency permits will only be extended if the pupils show commitment to their studies.
"A big responsibility lies on the politicians and government bodies to implement the legislation in a way that doesn't put the decision on who can stay and who can't upon teachers and school principals. A report of absence or a non-pass degree cannot be used as an expulsion document. Teachers are not border police, we are teachers."
If the students, after having finished their studies in upper secondary school, manage to get a stable a job within six months, they will have the possibility to gain a permanent residency permit in Sweden.