OTTAWA – Outgoing Canadian Ambassador to  the U.S. David MacNaughton is leaving diplomatic life to head up the Canadian operations of Palantir Technologies, the Silicon Valley-based data integration and analytics software giant.

MacNaughton announced last week that he would be stepping down as ambassador at the end of August to return to Canada to pursue a career in the private sector, after three years as Canada’s top American envoy.

As the president of the company's Canadian offices, MacNaughton’s role will be to "build relationships with Canadian organizations that are looking to transform how they use and make the most of their data," according to a press release from the company issued days later. Headquartered in Palo Alto, Calif., Palantir also has offices in New York, Washington, London, and Paris.

The company—co-founded by Facebook board member Peter Thiel— has recently faced criticism over its work with the U.S. Immigration and Customs Enforcement (ICE), which has been enforcing U.S. President Donald Trump's crackdown on undocumented immigrants. The firm—initially a CIA-funded startup— also builds software for banks, pharmaceutical companies, government organizations, and law enforcement.

"Many Canadian organizations have vast amounts of data," said MacNaughton in the release. "This data holds the key to innovation and efficiency for Canada's commercial enterprises, and Palantir has some of the best technology and most transformative partnerships in the world."

MacNaughton has been Canada’s ambassador since March 2016, and was a central figure during the NAFTA renegotiation process and efforts to lift the steel and aluminum tariffs that the Americans imposed during the talks.

Following that intense stretch of frosty relations between the two countries, MacNaughton has remained Canada's main contact on the ground in Washington, D.C. with Congress and Trump's administration on ratification of the new deal, as well as on other pressing issues including border security and ongoing tensions with China. Prior to his diplomatic post, MacNaughton co-chaired the 2015 Trudeau Liberal election campaign in Ontario, worked for past provincial Liberal leaders and was involved in government and public relations work.

President of Palantir Technologies Shyam Sankar said Canada is an "important partner with notable clients in the financial industry as well as with government entities," and "having David lead our team brings an unparalleled level of expertise in the Canadian private and public sectors."