Minister of Health Patty Hajdu looks on as Prime Minister Justin Trudeau speaks during a news conference in Ottawa, Wednesday March 11, 2020. Canada is announcing $1 billion ($730 million) in funding to help health-care workers cope with the increasing number of new cases of coronavirus and to help Canadian workers who are forced to isolate themselves. (Adrian Wyld/The Canadian Press via AP) Adrian Wyld

President Donald Trump speaks during a meeting with tourism industry executives about the coronavirus, in the Cabinet Room of the White House, Tuesday, March 17, 2020, in Washington. (AP Photo/Evan Vucci) Evan Vucci

Vehicles move across the Ambassador Bridge between Detroit and Windsor, Ontario, as viewed from Detroit, Monday, March 16, 2020. Canadian Prime Minister Justin Trudeau says he is closing his country's borders to anyone not a citizen, an American or a permanent resident amid the coronavirus outbreak. (AP Photo/Paul Sancya) Paul Sancya

Vehicles enter the United States as a bus drives to Canada in the Detroit-Windsor Tunnel in Detroit, Monday, March 16, 2020. Canadian Prime Minister Justin Trudeau says he is closing his country's borders to anyone not a citizen, an American or a permanent resident amid the coronavirus outbreak. (AP Photo/Paul Sancya) Paul Sancya

Vehicles enter the Detroit-Windsor Tunnel to travel to Canada in Detroit, Monday, March 16, 2020. Canadian Prime Minister Justin Trudeau says he is closing his country's borders to anyone not a citizen, an American or a permanent resident amid the coronavirus outbreak. (AP Photo/Paul Sancya) Paul Sancya

Vehicles enter the United States as a minivan drives to Canada in the Detroit-Windsor Tunnel in Detroit, Monday, March 16, 2020. Canadian Prime Minister Justin Trudeau says he is closing his country's borders to anyone not a citizen, an American or a permanent resident amid the coronavirus outbreak. (AP Photo/Paul Sancya) Paul Sancya

The U.S. and Canada have agreed to temporarily close their shared border to nonessential travel, President Donald Trump announced Wednesday, and the Trump administration is considering a plan to turn back all people who cross the border illegally from Mexico, two administration officials said.

Canada and the U.S. are eager to choke off the spread of the virus but also maintain their vital economic relationship. Canada relies on the U.S. for 75% of its exports.

Trump made the announcement on Twitter, saying the decision would not affect the flow of trade between the countries.

“We will be, by mutual consent, temporarily closing our Northern Border with Canada to non-essential traffic,” Trump tweeted.

As for Mexico, Trump would be using powers they say the president has during pandemics like the coronavirus outbreak to mount what would be one of the most aggressive attempts to curtail illegal immigration. The plan is under consideration and no final decisions have been made, according to the officials, who spoke to The Associated Press on the condition of anonymity because the plan hasn’t been announced.

Truck drivers and Canadian snowbirds, who live in the U.S. for part of the year and are returning to Canada, are among those expected to get an exemption. Completely closing the border would cause severe economic damage to both the U.S. and Canada as the two economies are integrated. Much of Canada’s food supply comes from or via the U.S., and and 98% of its oil exports go to the U.S.

About 18% of American exports go to Canada.

Canadian Prime Minister Justin Trudeau said Monday he would close the country’s borders to anyone not a citizen, an American or a permanent resident, and even then they must self-isolate for 14 days on arrival.

Trudeau said the exemption for Americans, despite the rapid rise of cases in the U.S., was due to “the level of integration of our two economies.”

For most people, the new coronavirus causes only mild or moderate symptoms, such as fever and cough. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia. The vast majority of people recover from the new virus.

The United States has seen about 6,500 coronavirus cases and more than 110 deaths while Canada has seen about 600 cases and eight deaths.

Canadian Deputy Prime Minister Chrystia Freeland said the border is vital to the daily life to people on both sides.

“Nearly 200,000 people cross that border every day, and that border and that traffic that goes across that border is literally a lifeline for both the Canadians and the Americans on both sides of that border,” Freeland said.

“We get our groceries thanks to truckers who drive back and forth across that border,” she said. “Very urgently needed medical supplies and medicines go back and forth across that border. And essential workers go back and forth across that border every day. So it is a unique relationship for Canada, and it’s important for us in handling our situation on the border to be sure that we act to get things right.”

But many people in Canada criticized the decision to give Americans an exemption. British Columbia Health Minister Adrian Dix said he vehemently disagreed with the American exemption given the surge in cases in neighboring Washington state.

Bruce Heyman, a former U.S. ambassador to Canada, said both countries recognize how many people cross the border daily.

“Border traffic has already slowed and in line with recommendations to stay home and eliminate nonessential movement,” Heyman said. “New rules jointly accepted for our shared border makes sense.”

Robert Bothwell, a professor of Canadian history and international relations at the University of Toronto, said the government-to-government accord merely ratifies what is already in place.

“Tourism in the age of the coronavirus is a contradiction in terms,” Bothwell said. “And no Canadian in his or her right mind would want to be caught with the virus on the U.S. side of the border, given the predatory U.S. medical pricing system. Actually, the insurance companies have already taken care of the problem. Many of us have received notices that they will not pay for virus treatment south of the border.”

As for the Mexian border officials said the president has authority to take such action in a pandemic and that Mexico’s efforts to stop the spread of the coronavirus, along with Venezuela’s, have been the weakest in North and South America. The officials said its authority relies on a law that gives the president authority to deny entry to people or to reject cargo if the Surgeon General determines there is “serious danger” of bringing a communicable disease to the United States.

There were more than 851,000 arrests for crossing the Mexican border during the 2019 fiscal year, which ended Sept. 30. The new policy would not apply to asylum-seekers who present themselves at land ports of entry, the official said.