A Colombian court has sentenced former intelligence chief Jorge Noguera to 25 years in prison for collaborating with paramilitary death squads.
He was found guilty of allowing right-wing paramilitaries to infiltrate the intelligence service, and helping them murder an academic activist.
Mr Noguera led Colombia's Administrative Security Department (DAS) from 2002 to 2005.
He was a close ally of the president at the time, Alvaro Uribe.
Noguera always denied any wrongdoing, but he resigned his post in 2005 amid accusations that he was working with paramilitary death squads, including supplying the names of trade unionists and human right workers.
He was made head of DAS by Mr Uribe, who was in office from 2002 to 2010.
In response to his conviction, Mr Uribe apologised for having appointed him.
"I trusted him. If he committed crimes that hurts me and I offer apologies to the citizens," Mr Uribe wrote on Twitter.
Paramilitary groups have been blamed for some of the worst atrocities in Colombia's long civil conflict.
They were formed in the 1980s to fight left-wing rebels, but - like their guerrilla enemies - have also been heavily involved in the cocaine trade.
Mr Uribe made the demobilisation of the main paramilitary group - the United Self-Defence Forces of Colombia (AUC) - one of the cornerstones of his security policy, along with tough action against the guerrillas.
But members of his administration, as well as the Colombian army, have been accused of collaborating with paramilitaries.
Noguera's case is one of a series of scandals to hit the DAS in recent years.
Another former head of the DAS, Maria del Pilar Hurtado, and Mr Uribe's former chief of staff, Bernardo Moreno, are facing trial over allegedly ordering wiretaps of government opponents.
Ms Hurtado is currently in Panama, where she has been granted asylum.
The DAS answers only to the president, but Mr Uribe has repeatedly denied issuing any orders that violated the law or the constitution.