David MacNaughton, who helped see Canada through the difficult NAFTA renegotiations, is leaving his position as Canada's ambassador to the United States at the end of the month.

In a statement, MacNaughton called the decision "bittersweet."

"Serving as Canada's ambassador in Washington, at this pivotal time in our country's history, has been the greatest honour of my life," he said.

"I cannot help but recall the dire situation we faced in early 2017, with Canada's most important trading relationship in grave peril. And hundreds of thousands of Canadians' livelihoods hanging in the balance."

Canada's deputy ambassador to the United States, Kirsten Hillman, will take over as acting ambassador. A spokesperson for the Prime Minister's Office said there likely won't be a replacement named for MacNaughton until after the October federal election.

In a news conference announcing his resignation, MacNaughton discussed how threats to this relationship made his tenure as ambassador particularly challenging.

"I have never done anything in my life that has been as difficult as this. Physically, emotionally. And part of that is just realizing what the stakes are," he said.

U.S. Ambassador David MacNaughton is leaving his post and says his experience over the last three-and-a-half years has been "extraordinarily special." 1:33

"The prime minister had me go right across the country to meet with provincial governments and with business leaders and community leaders. I got to understand what small changes might mean to small communities."

Prime Minister Justin Trudeau in a statement said he accepted MacNaughton's resignation with "great affection and gratitude — and of course, considerable regret."

"David has long been and remains a trusted adviser, friend and counsellor. But he is more than that: he is a Canadian patriot, one whose honesty, moderation and wisdom were pivotal to Team Canada in our successful renegotiation of NAFTA in 2017 and 2018. For this, he has earned every Canadian's gratitude," he said in a statement.

A source with direct knowledge said MacNaughton, who had been ambassador since 2016, has been thinking about stepping down for awhile to spend more time with his family. His wife Leslie has been based in Toronto while he has been in Washington. They have six grandchildren.

The source, who spoke on condition of anonymity, said MacNaughton plans to advise the Liberals from the sidelines during the upcoming campaign.

MacNaughton told journalists Thursday that he would continue to advise Trudeau if asked to do so.

"I am available to the prime minister and to my friends and colleagues to provide advice and counsel whenever they want to seek it. I have indicated to them that I am quite prepared to," MacNaughton said.

"I have never been shy about offering my opinions."

Saw Canada through new NAFTA negotiations

Foreign Affairs Minister Chrystia Freeland attributed both the United States-Mexico-Canada Agreement and securing the removal of the U.S. tariffs on Canadian steel and aluminum to MacNaughton's leadership.

"Over these past few years, I have come to rely on David's insight, intelligence and grit as a negotiator, so it is with immense personal appreciation — and a degree of sadness — that I mark his departure from this key diplomatic post," she said.

U.S. Trade Representative Robert Lighthizer, who led the U.S. through last summer's tumultuous negotiations, called MacNaughton "a highly skilled negotiator and diplomat."

"We developed a good working relationship and became friends," he tweeted Thursday.

MacNaughton, left, opens the door for Canada's Foreign Affairs Minister Chrystia Freeland after she spoke to media about trade talks at the Office of the United States Trade Representative in Washington, Aug. 29, 2018. THE CANADIAN PRESS/AP-Jacquelyn Martin (Jacquelyn Martin/Canadian Press)

During his announcement, MacNaughton also reminisced about his relationships with Freeland and Lighthizer.

"After the NAFTA agreement was concluded, I sat with Minister Freeland and Ambassador Lighthizer in [Freeland's] dining room when she cooked a meal and we had a celebration of what we had together achieved," he recalled.

"This embassy is in good hands," MacNaughton said of his successor, describing Hillman as an "extraordinary talent" in terms of her knowledge of U.S. trade policy and her leadership within the embassy.

Best wishes to <a href="https://twitter.com/AmbMacNaughton?ref_src=twsrc%5Etfw">@AmbMacNaughton</a> as he takes his next steps forward. During USMCA negotiations, we developed a good working relationship & became friends. He is a highly skilled negotiator & diplomat. The U.S. has been fortunate to have him as Canada’s representative in D.C. –ARL <a href="https://t.co/wB3UianQXM">pic.twitter.com/wB3UianQXM</a> —@USTradeRep

MacNaughton took the position three years ago when Barack Obama was U.S. president.

Before that, he served as Ontario co-chair in the Liberals' 2015 election campaign.

His ties to Trudeau's Liberals go back to Queen's Park, where he worked with two of the prime minister's formative aides: chief of staff Katie Telford and former principal secretary Gerry Butts, who is returning to the team after stepping down during the height of the SNC-Lavalin affair.