Mexico and the United States have announced plans to sharply limit travel over their busy shared border as part of efforts to control the spread of the coronavirus.

US President Donald Trump and Mexican Foreign Secretary Marcelo Ebrard said on Friday the two governments agreed to prohibit recreational and tourist travel, similar to the restrictions put in place earlier this week along the US-Canada border.

Trump said the actions with the country's North American partners "will save countless lives".

More:

There would be no ban on people travelling for work or other essential activities and there would be no halt to commercial traffic, Ebrard said.

"Everyone else is not expected to have any difficulties," he said. "We're not talking about closing it."

Secretary of State Mike Pompeo said the restrictions would take effect at midnight on Friday.

The US, Mexico and Canada have also worked out a new agreement to immediately return some people trying to illegally cross the borders, officials said.

By excluding commercial traffic from the ban, the two governments substantially softened the economic effects. Fewer Americans are also heading south because of a statewide stay-at-home order in California and a State Department warning advising Americans not to travel abroad.

Still, the restrictions are a significant development along the world's most heavily crossed border.

Acting US Homeland Security Secretary Chad Wolf told reporters at the White House that the restrictions were aimed at eliminating nonessential travel across that border.

Mexico's Foreign Secretary Marcelo Ebrard speaking during a news conference in Mexico City, Mexico [File: Edgard Garrido/Reuters]

"We want to make sure that cargo continues, trade continues, healthcare workers continue to be able to traverse that border. But tourism, some recreational activities and other things needs to stop during this crisis," he said.

US Customs and Border Protection officials briefed business leaders on Thursday on the plans to prohibit nonessential travel to and from Mexico, said Paola Avila, chair of the Border Trade Alliance, a business group.

US officials provided a long list of "essential" workers that would be unaffected going to and from their jobs, including farmworkers, restaurant and grocery store employees and bus drivers, said Avila. Mexico was preparing similar restrictions on visitors from the US.

Keeping trade flowing, as the US and Canada agreed to do, contains the economic damage. Mexico is the US's largest trading partner, just ahead of Canada. The US accounts for about 75 percent of Mexican exports, including autos, computers and medical devices.

While halting travel for students, shoppers, families and many workers would be a major blow to border economies, the impact has already been felt.

The State Department on Thursday issued a new travel alert urging Americans not to go abroad under any circumstances and to return home if they are already abroad unless they plan to remain overseas. California Governor Gavin Newsom ordered the state's 40 million residents to stay at home, restricting nonessential movements.

"People are not crossing anyway," said Avila, who is also the San Diego Regional Chamber of Commerce vice president for international business affairs. "This is the right thing to do. If you don't have to cross, don't."

The US has also been considering whether to immediately turn back to Mexico anyone who crosses the border illegally, including asylum-seekers. Trump said on Wednesday that he planned to announce such a measure "very soon", relying on a law that says he can deny entry to people or reject cargo if the US surgeon general determines there is a "serious danger" of bringing a communicable disease to the US.