OTTAWA (Reuters) - Canadian Security Intelligence Service (CSIS) Director David Vigneault, who had come under pressure about the spy agency's handling of foreign interference in Canada, announced his retirement on Thursday and said he would leave public service.

Vigneault, in a statement, said that "the time has come to pass the baton to a successor," without delving further into why he was stepping down. He took over as head of the agency in June 2017 after serving as a security advisor to Prime Minister Justin Trudeau's cabinet.

His retirement comes as Canada assesses the extent and impact of foreign interference in internal affairs. An official probe said in May there was evidence of foreign interference in Canada's last two federal elections but the results were not impacted.

"I'm extremely proud of the work that my team and I have accomplished in recent years at CSIS, bringing the organization out of the shadows, and shedding light on the important and valuable role we play in protecting Canadians against foreign interference and threats to national security," Vigneault said in a statement.

"This has been one of the most challenging and rewarding period in my career," he said.

Canada's Public Safety Minister Dominic LeBlanc thanked Vigneault in a post on social media X.

"Vigneault has spent his entire career in the service of Canadians ... as he announces his retirement from CSIS, I want to wish him the very best in this next chapter," LeBlanc said.

(Reporting by Ismail Shakil in Ottawa; editing by Diane Craft)