Poland's parliament on Thursday passed a legal amendment allowing migrants to be pushed back at the border and for asylum claims made by those who entered illegally to be ignored.
Lawmakers also gave the green light to a government plan to build a wall to prevent migrants from crossing the border from Belarus, a project estimated to cost 353 million euros ($410 million).
Thousands of migrants, most of them from the Middle East, have sought in recent months to cross from Belarus into Poland or fellow EU member states Latvia and Lithuania.
Under the newly amended law, a foreigner stopped after crossing the Polish border illegally will be obliged to leave Polish territory and will be temporarily banned from entering the country for a period ranging from "six months to three years".
The Polish authorities will also have the right "to leave unexamined" an asylum application filed by a foreigner who is stopped immediately after illegally entering, unless they have arrived from a country where their "life and freedom are threatened".
Rights groups have already accused Poland of stopping migrants at the border and pushing them back into Belarus.
Numerous NGOs have criticised Poland for imposing a state of emergency at the border, which prevents humanitarian organisations from helping migrants and prohibits access to all non-residents, including journalists.
The law change came two days after a landmark ruling from Poland's Constitutional Court challenged the primacy of European Union law -- a key tenet of EU membership -- by declaring important articles in the EU treaties "incompatible" with the Polish constitution.
The ruling on a case brought by Poland's right-wing populist government could threaten EU funding for Poland and is being seen as a possible first step to Poland leaving the European Union.
Earlier Thursday Polish police said that another migrant had been found dead on the border with Belarus, bringing the number of people who have died along the European Union's eastern border in recent months to seven.
The European Union accuses Belarus of deliberately orchestrating the influx in retaliation against EU sanctions over the Moscow-backed regime's crackdown on dissent.
Last month the UN refugee agency and the International Organization for Migration said they were "shocked and dismayed" by the migrant deaths.
"Groups of people have become stranded for weeks, unable to access any form of assistance, asylum or basic services," they said in a statement.
In August Christine Goyer, UNHCR representative in Poland, reminded Warsaw that "according to the 1951 Refugee Convention, to which Poland is signatory, people seeking asylum should never be penalised, even for irregular border crossing".