WASHINGTON — President Donald Trump issued an order Friday to deny asylum to migrants who enter the country illegally, tightening the border as caravans of Central Americans slowly approach the country. The plan was immediately challenged in court.

Trump invoked the same powers he used last year to impose a travel ban that was upheld by the Supreme Court. The new regulations are intended to circumvent laws stating that anyone is eligible for asylum no matter how he or she enters the country. About 70,000 people per year who enter the country illegally claim asylum, officials said.

“We need people in our country but they have to come in legally,” Trump said Friday as he departed for Paris.

The American Civil Liberties Union and other legal groups sued in federal court in Northern California to block the regulations, arguing the measures were clearly illegal.

“The president is simply trying to run roughshod over Congress’ decision to provide asylum to those in danger regardless of the manner of one’s entry,” said ACLU attorney Lee Gelernt.

The litigation also seeks to put the rules on hold while the litigation progresses.

The regulations go into effect Saturday. They would be in place for at least three months but could be extended, and don’t affect people already in the country. The Justice Department said the regulations are lawful.

Trump’s announcement was the latest push to enforce a hard-line stance on immigration through regulatory changes and presidential orders, bypassing Congress, which has not passed any immigration law reform. But those efforts have been largely thwarted by legal challenges and, in the case of family separations this year, stymied by a global outcry that prompted Trump to retreat.

Officials said the asylum law changes are meant to funnel migrants through official border crossings for speedy rulings instead of having them try to circumvent such crossings on the nearly 2,000-mile border.

But the busy ports of entry already have long lines and waits, forcing immigration officials to tell some migrants to turn around and come back to make their claims. Even despite that, illegal crossings are historically low.

Backlogs have become especially bad in recent months at crossings in Arizona, California and Texas, with some people waiting five weeks to try to claim asylum at San Diego’s main crossing.

Administration officials said those denied asylum under the proclamation may be eligible for similar forms of protection if they fear returning to their countries, though they would be subject to a tougher threshold. Those forms of protection include “withholding of removal” — which is similar to asylum, but doesn’t allow for green cards or bringing families — or protection under the United Nations Convention Against Torture.

About 500 Central American migrants departed Mexico City early Friday and headed toward the northern city of Tijuana — a longer and likely safer route to the U.S. border — while thousands more were waiting another day at an improvised shelter.