OTTAWA -- Michel Coulombe, a career spy who joined the fledgling Canadian Security Intelligence Service more than 30 years ago before rising through the ranks to its top job, is retiring.

Coulombe told CSIS employees Monday that he will leave as director of the country's spy agency at the end of May in order to move on to the next stage of his life and spend more time with his family.

Coulombe, an engineering graduate from Ecole Polytechnique in Montreal, joined the agency in 1986, just two years after it was created.

In 2013, he became its eighth director, the first time the top job had been filled from inside the service.

"After 36 years with the federal government, including more than 30 years with CSIS, I feel it is time for me to move on to the next stage of my life with my family," Coulombe said in a statement posted on the agency website.

"It has been an honour to work with the dedicated professionals of the national security community and a privilege to serve all Canadians. I thank all CSIS employees for their support and the work they do every day to keep our country safe."

Before he was appointed director, Coulombe filled a number of key roles in the organization.

From 2010 to 2013, he was deputy director of operations. Before that, he was assistant director of foreign collection, overseeing operations abroad, and assistant director of intelligence, responsible for intelligence analysis and the security screening program.

He also served in CSIS regional offices, including as director general of the Quebec region.

His tenure covered almost all of the agency's existence. He joined as the service went through the process of moving away from the RCMP, splitting intelligence services from the national police force for the first time.

He watched security threats evolve. He saw the Cold War end with the collapse of the Soviet Union, only to see other dangers loom, including terrorism both homegrown and imported and a resurgent, post-Soviet Russia.

He had some touchy moments, including a case last year in which a Federal Court judge ruled that the agency illegally kept potentially revealing electronic data about people over a 10-year period.

Justice Simon Noel said the service breached its duty to inform the court of its data-collection program, since the information was gathered using judicial warrants.

Coulombe at the time said his agency had halted all access to -- and analysis of -- the data in question while the decision was under review.

"I deeply regret the court's serious concerns with respect to meeting our duty of candour and I commit to continuing my efforts, with the deputy minister of justice, to address this concern," he said.

But it was also under Coulombe's tenure that the agency demonstrated that it had a sense of humour. "Yes, we're on Twitter," CSIS tweeted when it joined the social media platform. "Now it's your turn to follow us."

Coulombe's departure marks the second high-profile retirement this month: RCMP commissioner Bob Paulson announced last week he would step down from his role as top Mountie at the end of June.