The law, whose approval is seen as a victory for President Donald Trump, means that it will be mandatory to detain a paperless person suspected of theft or more serious crime.
In parallel with this, Trump has ordered 1,500 military personnel to head towards the border with Mexico to strengthen border surveillance.
These forces will work with the placement of physical barriers and other border tasks. They will begin their work within the next 24-48 hours, they are on their way right now, a Pentagon official told reporters late on Wednesday Swedish time.
The new president has promised a significant tightening of legislation regarding migration and has also set his sights on mass deportations.