WASHINGTON (NewsNation) — The Biden administration announced on Tuesday it would immediately begin turning away Cubans, Haitians and Nicaraguans who cross the U.S.-Mexico border illegally,  a major expansion of an existing effort to stop Venezuelans attempting to enter the U.S.

Instead, the administration will accept a total of 30,000 people per month from the four nations for two years and offer the potential to work here legally, as long as they come legally, have eligible sponsors and pass vetting and background checks. The four affected nations are among those for whom migrant border crossings have risen most sharply, with no easy way to quickly return migrants to their home countries.

“Do not just show up at the border,” Biden said Thursday. “Stay where you are and apply legally from there.”

This comes as Border Patrol agents continue to see a surge in people arriving at the border. It’s a major change to immigration rules that will stand even if the U.S. Supreme Court ends the Trump-era public health rule Title 42, designed to limit the spread of disease by expelling asylum seekers on the southern border.

The president has seen the numbers of migrants crossing the U.S.-Mexico border rise dramatically during his two years in office. There were more than 2.38 million stops during the fiscal year that ended Sept. 30, the first time the number cracked 2 million. The administration has struggled to clamp down on crossings, reluctant to take hard-line measures that would resemble those of the Trump administration.

That has resulted in relentless criticism from Republicans who say the Democratic president is ineffective on border security. The newly minted Republican House majority has promised congressional investigations.

Republicans including Oklahoma Sen. James Lankford wasted no time in responding to Biden’s announcement.

“My simple question is, why haven’t you done those things in the last two years?” Lankford asked in a video posted on his Twitter account Thursday. “We’ve seen record numbers of people illegally crossing the southern border. I have said now for two years, the president has authorities he’s choosing not to use.”

The new policy could result in 360,000 people from these four nations lawfully entering the U.S. in a year, a huge number. But currently, far more people from those countries are attempting to cross into the U.S. on foot, via boat or by swimming. Migrants from those four countries were stopped 82,286 times in November alone.

“This new process is orderly,” Biden said. “It’s safe and humane, and it works.”

Biden planned a trip to El Paso, Texas, this weekend, his first trip to the southern border as president, before a planned trip to Mexico City to meet with North American leaders on Monday.

Mexico has agreed to accept each month from the four countries up to 30,000 migrants who attempt to walk or swim across the U.S.-Mexico border, according to the White House.

Anyone coming to the U.S. is allowed to claim asylum, regardless of how they crossed the border, and migrants seeking a better life in the U.S. often pay smugglers the equivalent of thousands of dollars to deliver them across the dangerous Darien Gap. But the requirements for granting asylum are narrow, and only about 30% of applications are granted. That has created a system in which migrants come between ports of entry and are allowed into the U.S. to wait out their cases. But there is a 2-million-case immigration court backlog, so cases often are not heard for years.

The move, while not unexpected, drew swift criticism from asylum and immigration advocates, who have had a rocky relationship with the president.

Biden, who took office in January 2021, has struggled with record numbers of migrants caught crossing the U.S.-Mexico border, and migration is expected to be on the agenda at the meeting in Mexico.

The increased focus from Biden on the border also comes as the president prepares for a 2024 reelection bid. His sole declared potential rival, former President Donald Trump, rose to the top of the GOP ranks by animating his party’s base with his hard-line stances on immigration.

Under the Trump administration, the U.S. required asylum seekers to wait across the border in Mexico. But massive delays in the immigration system created long delays, leading to fetid, dangerous camps over the border where migrants were forced to wait. That system was ended under the Biden administration, and the migrants who are returned now to Mexico under the new rules will not be eligible for asylum.

Biden has agreed to triple the number of refugees accepted to the U.S. from the Western Hemisphere to 20,000 from Latin America and Caribbean over the next two years. Both refugees and asylum seekers have to meet the same criteria to be allowed into the country, but they arrive through different means.

At the U.S.-Mexico border, migrants have been denied a chance to seek asylum under U.S. and international law 2.5 million times since March 2020 under the Title 42 restrictions, introduced as an emergency health measure by Trump to prevent the spread of COVID-19, but there always has been criticism that the restrictions were used as a pretext by Republican to seal off the border.

Even with the restrictions, there are still large increases in the number of migrants arriving.

Biden moved to end the Title 42 restrictions, and Republicans sued to keep them. The U.S. Supreme Court has kept the rules in place for now. White House officials say they still believe the restrictions should end, but they believe they can continue to turn away migrants under existing immigration law.

Cubans, who are leaving the island nation in their largest numbers in six decades, were stopped 34,675 times at the U.S. border with Mexico in November, up 21% from 28,848 times in October. Nicaraguans, a large reason why El Paso has become the busiest corridor for illegal crossings, were stopped 34,209 times, up 65% from 20,920 in October.

But Venezuelans were seen far less after Mexico agreed on Oct. 12 to begin accepting those expelled from the United States. They were stopped 7,931 times, down 64% from 22,045 in October.

Meanwhile, border officials are also creating an online appointment portal to help reduce wait times at U.S. ports of entry for those coming legally. It will allow people to set up an appointment to come and ask to be allowed into the country.

The Associated Press and Reuters contributed to this story.