The seeds for the impending partial shutdown of the Canada-U.S. border were planted on the morning of Sept. 11, 2001, in the frenzied aftermath of terrorist attacks.

A direct consequence of that day's chaos was the idea that you could segregate commercial from non-commercial travel, and continue shipping goods during a shutdown.

Now, at midnight Saturday, amid the spreading COVID-19 pandemic, the countries will suspend non-essential, non-commercial travel, while allowing trade to continue.

It took new technology, years of country-to-country communication, and a recognition that shutting the border entirely would make a potential catastrophe that much worse.

All of which were lacking that fateful morning 19 years ago.

A firefighter walks amid rubble near the base of the destroyed World Trade Center in New York on Sept. 11, 2001. (Peter Morgan/Reuters)

Michael Kergin, who was Canada's ambassador to the U.S. at the time, recalls the moment he learned the U.S. had snapped its border shut, without anyone giving him a heads-up.

He'd watched the planes hit the World Trade Center from a TV in his office at the Canadian Embassy in Washington.

Later, he saw black smoke rising over the horizon, across the Potomac River, where another plane had struck the Pentagon. He got a call from Jean Chrétien and remembers something the prime minister told him: "The world will never be the same again."

That's certainly true of the border.

Back then, the U.S. acted immediately, without informing Ottawa. At 10:05 a.m. ET , the border was essentially sealed by a Level 1 customs alert ordered by the White House.

"It was not communicated to us that, 'We are about to close your border.' It was, 'We've closed your border,'" Kergin recalled. "No trucks [passing], no people."

Former Canadian ambassador to Washington Michael Kergin recalls lineups of many kilometres at Ontario border crossings with the U.S., like this one, at the Peace Bridge in Fort Erie, seen on Sept. 12, 2001. (Harry Rosettani/The Canadian Press)

Monster lineups formed immediately, as the world's so-called longest undefended border became a no-go zone.

It was particularly crippling to the auto industry, which relies on parts shipped back and forth for final assembly, in one of this continent's most critical economic sectors.

"They were talking about trucks idling 20 kilometres deep," Kergin said.

"Guys were just sleeping in their trucks."

Frantic Detroit automakers began shutting down factories by week's end, while pleading with George W. Bush's administration to ease up.

In a sign of the severity of the current crisis, the major automakers announced this week they will shut down all North American production because of the COVID-19 pandemic.

But back in 2001, Kergin managed to reach the president's chief of staff by phone the day after the attacks and found Andy Card sympathetic to his arguments.

So the countries began experimenting, within days, with crude improvised systems — and it was those improvisations that foreshadowed reforms ahead.

Operating on a case-by-case basis, U.S. border agents began waving through the cargo and travellers they deemed low-risk.

"[It was] very ad hoc," Kergin said.

"[But] that sort of established the border we know now — with different kinds of security and fast lanes and all that kind of good stuff."

Two months later, an initial deal for a so-called smart border was signed by Foreign Affairs Minister John Manley and his U.S. counterpart, Tom Ridge.

Foreign Affairs Minister John Manley, right, and U.S. Secretary of Homeland Security Tom Ridge, left, signed the first Smart Border Declaration in 2001, and met here, in 2003, to review implementation. (Tobin Grimshaw/The Canadian Press)

Subsequent leaders in both countries kept adding to it, including prime ministers Paul Martin, Stephen Harper and Justin Trudeau, and presidents Barack Obama and Donald Trump. Those efforts produced the Security and Prosperity Partnership, the Beyond the Border program, and, most recently, the new NAFTA.

Innovations included separate trucking lanes dedicated to cargo. There were new trusted-traveller programs, trusted- trader programs, and customs pre-clearance , so that cargo might get screened in advance.

One important innovation is now embedded in the new NAFTA's Chapter 7. It requires cargo manifests to be filed digitally, which allows for initial risk assessments hours before goods hit the border.

Before the Sept. 11 attacks, says trade lawyer Dan Ujczo, shippers filled out manifests by hand. He says the crisis spurred technological improvements that were already needed.

"The border was broken before 9/11.... The infrastructure was crumbling," he said.

Traffic never fully recovered

Despite the innovations, the legacy of 9/11 has unquestionably had damaging effects on the flow of people between the countries. Prior to the reforms, people could cross more easily, without passports.

Land traffic has never recovered from 9/11.

Data from the U.S. Department of Transportation shows the volume of passenger vehicles crossing into the U.S. never returned to its pre-2001 peak — it was still 27 per cent lower last year than in 2000.

The trend line is slightly less stark for commercial trucks: there were 19 per cent fewer trucks crossing into the U.S. from the northern border last year compared to 2000.

For clues about why it became more difficult to drive across the border, look no further than the landmark U.S. government study into the attacks.

The 9/11 commission report recommended new biometric passports as a requirement for any American, Canadian or Mexican to cross the border, and that became U.S. policy .

But it also acknowledged the likely damage that would cause. To mitigate that damage, the commission suggested new trusted-traveller programs like the ones we have today.

Ujczo said he's convinced that if COVID-19 had occurred two decades ago, the border would have been hammered shut.

"I guarantee you," said Ujczo, a lawyer at Dickinson Wright.

"There's not a doubt they would have shut the border completely — had we not had this painful lesson from history.… We now know you can't shut down the border."

He credits 19 years of conversations about supply chains and border technology.

The process is ongoing.

Border business already taking a hit

Now the countries are experimenting with things like artificial intelligence and blockchain to allow for more frictionless trade.

Eric Miller, who worked on the Beyond the Border program for the Canadian government, said he hopes the current crisis spurs additional innovations.

One idea floating around border-policy circles is co-managed border checkpoints. In such an arrangement, border checkpoints would be binational, allowing Canada and the U.S. to share personnel and technology, save money and divert resources to under-staffed areas.

"What is going to be the legacy of this event at the border?" said Miller, now a trade consultant at the Rideau Potomac Strategy Group in Washington.

For now, it means you can still get California blueberries this spring, but you can't host your relatives from California.

It also means additional hardship for businesses that rely on personal travel across the border.

In border states, the early economic numbers are brutal.

Data provided to CBC News from the government of Michigan showed initial jobless claims were up 400 per cent on Monday from the recent average, with 5,400 claims in just one day.

In New York state, the system for handling jobless claims was so overwhelmed it stalled this week.

Workers clear tables and chairs from New York's Times Square, which is no longer bustling with tourists as the city grapples with the COVID-19 pandemic. (Carlo Allegri/Reuters)

The state experienced an unprecedented surge in claims, including 21,000 calls and 110,000 website visits on Tuesday morning alone, compared with 2,000 phone calls and 42,000 website visits for all of the previous Tuesday.

Popular cross-border destinations are already closed, like restaurants in Detroit's Greektown . The travel shutdown is just one more blow.

"You're going to see border communities, tourism, conventions, all of that stuff, messed up," Miller said of the border closing. "It's going to be a mess. It's going to be a big blow to the economies more broadly.

"But it does seem they have learned the [9/11] lesson of not doing sudden stops."