OTTAWA -- Former prime minister Brian Mulroney offered a spirited defence of the North American Free Trade Agreement in Washington on Tuesday, while warning about the potential impacts of a U.S. withdrawal from the deal.

The comments came as Mulroney appeared before the U.S. Senate committee on foreign relations, only days after the latest round of NAFTA discussions ended in Montreal with guarded optimism about the future.

Mulroney was warmly greeted by the majority of U.S. senators on the committee, who were largely united in their belief that while NAFTA needs to be modernized, the deal itself had been a boon to their country and North America.

It was also clear that many of the committee members worried about U.S. President Donald Trump's constant threats to pull out of the trade deal, which he has called a terrible agreement for the U.S.

Mulroney, who didn't mention Trump by name through his appearance, launched his testimony by recalling a conversation with Ronald Reagan in 1985, which served as the genesis of what would eventually become NAFTA.

He went on to assert in no uncertain terms that free trade had benefited the United States and Canada from an economic perspective and by cementing the most peaceful and prosperous bilateral relationship in history.

"NAFTA did not happen by accident," Mulroney said. "In large measure it was the result of the leadership and vision of three great American presidents: Ronald Reagan, George Herbert Walker Bush and Bill Clinton."

Mulroney referenced the three former U.S. presidents several times during his testimony.

Much of Trump's criticism about the trade deal has centred on concerns about a U.S. trade deficit with Canada and Mexico, meaning the Americans import more than they export.

Mulroney contradicted such assessments, saying the U.S. actually enjoyed a $7.7 billion (U.S.) surplus in goods and services with Canada last year, while noting substantial Canadian and Mexican investments in the U.S. since the deal.

"How do you explain today a 4.1 per cent unemployment rate in the United States, and a similar rate in Canada and growing prosperity in Mexico?" Mulroney said.

"What happened, of course, is that we got together and we built a $21-trillion market with millions and millions of new jobs in North America, in all places."

One of the key themes in Mulroney's testimony was the role that Canada plays in assisting the U.S. with its national security, whether by protecting its northern border or in its fight against the Islamic State group.

But the prime minister said such assistance is contingent on the strength of the Canadian economy, which is highly reliant on its trading relationship with the United States.

"And if that is amputated from our relationship, our co-operation in security and in (ISIL) and in the military and NATO and NORAD, all of these things is lessened," Mulroney said.

"Because it diminishes our wealth and our capacity to contribute to joint or trilateral endeavours."

Mulroney was appearing alongside former U.S. ambassador Earl Anthony Wayne and former Mexican secretary of commerce Jaime Serra Puche, both of whom played key roles in negotiating NAFTA more than 25 years ago.

Wayne warned of significant job losses in the U.S. should the Trump administration decide to withdraw from the trade deal, an assessment that was echoed by many of the senators on the committee.

Serra, meanwhile, said any attempt to withdraw the deal would be like trying to "unscramble an egg," a reference to the many cross-border trade and manufacturing arrangements that have flourished since NAFTA came into force.

The seventh round of NAFTA talks is scheduled to be held in Mexico City from Feb. 26 to March 6.