He revealed confidential information 24 times in the book, in particular regarding the operations of the Danish Security and Intelligence Service (PET) and the agency's methods of working, a Copenhagen court said in its judgement seen by AFP.
The judges noted that the revelations in “Seven Years at PET: the Era of Jakob Scharf” were done for commercial reasons.
Scharf, 52, was the head of PET from 2007 to 2013 at a time when Denmark was the target of attacks following the publication of caricatures of the Prophet Mohammed.
The book was written with a journalist from Denmark's newspaper of record, Politiken, which in October 2016 published the memoir to protest against censorship, after authorities had banned the book from being sold.
The paper's editor-in-chief in January was fined 50,000 kroner (€6,700) for having defied the ban.