Prime Minister Pedro Sanchez's government hailed the plan as "an act of justice and a necessity." It will allow unauthorized migrants to apply for temporary residence permits instead, and to start paying taxes.