Officials in both countries celebrated the news. The project has involved both U.S. political parties and the Harper and Trudeau governments, yet some participants had begun worrying it might stall from inertia.

The so-called preclearance bill has now been adopted by both U.S. legislative chambers after being passed by the Senate early Saturday. It's now expected to become law with President Barack Obama's signature.

WASHINGTON — A bill with potentially sweeping consequences for the Canada-U.S. border has just been adopted by the American Congress, allowing new projects aimed at speeding up travel through the international boundary.

Vehicles make their way through the Canadian border crossing in Niagara Falls on Jan. 23. (Photo: Cole Burston/Bloomberg via Getty Images)

It was finally taken up in the last moments of the current Congress, passed first by the House of Representatives and then the Senate this week as lawmakers prepared to dissolve and reconvene a new post-election legislature after the holidays.

"Great news,'' Prime Minister Justin Trudeau tweeted Saturday. "One step closer to easier travel and trade between our countries.''

The Canadian government had been lobbying lawmakers to make it a priority, and pass the legislation required to implement different agreements signed with the Obama administration by Canada's Conservative and Liberal governments.

“Preclearance is a win-win for enhanced security and prosperity on both sides of the border.”

The latest agreement was announced earlier this year during a news conference in the White House Rose Garden by Prime Minister Justin Trudeau and President Obama, who agreed to sites for preclearance experiments.

The pilot projects will take place at Montreal's train station and on Western Canada's Rocky Mountaineer train line.

The projects will establish U.S. customs offices on the Canadian side of the border allowing travellers, in theory, to get screened more quickly, zip through the actual border, and ease the logjams that slow travel and commerce.

It's part of broader efforts to speed up movement, slowed by security measures after the 9-11 attacks, without sacrificing safety.

Preclearance will feel familiar to many Canadians.

That's because 12 million passengers already use it each year at Canadian airports, eight of which have U.S. customs facilities. The latest Trudeau-Obama deal extended that to two more airports: Toronto's Billy Bishop and Quebec City's Jean Lesage.

The more significant change is that the new agreements allow the system to be extended to every mode of transportation: first trains, then buses, and potentially someday even car travel, might be able to clear the border earlier.

The agreements also allow American customs agents to carry weapons within Canada, question people, and detain, but not arrest, them. The legislation that passed Saturday also allows agents accused of crimes at work to be prosecuted in the U.S.

A senator who sponsored the bill hailed its adoption.

“It would make it possible to restore Amtrak service between Vermont and Quebec in the future.”

"This agreement has long been a priority for Vermonters,'' said Democrat Patrick Leahy.

"It would make it possible to restore Amtrak service between Vermont and Quebec in the future... Now, at last, we can confidently move to the next stages of getting passenger service to Montreal up and running.

"Many of us can't wait to hear those first whistles blow.''

It passed the House on Wednesday. In that chamber, New York Republican Elise Stefanik called it great news for Canada-U.S. relations.

"Canada is more than just a bordering nation. They are our neighbours, our friends and our largest trading partner,'' she said. "Plattsburgh, a city in my district, has even branded itself as Montreal's U.S. suburb.''

There's one final legislative step remaining — in Canada. A similar bill to the one that just passed the U.S. Congress, C-23, has been introduced by the Liberal government, and is expected to have broad support in the House of Commons.

Also on HuffPost