Well-known Dublin historian Shane MacThomais gave a final salute before he took his own life in Glasnevin Cemetery, an inquest has heard.
The 46-year-old from Ashford Street in Stoneybatter, Dublin 7, was found hanging at the cemetery on March 20 last year.
Dublin Coroner's Court heard he was seen on CCTV entering the cemetery via a staff entrance at around 7pm the night before. Garda Tara Dolan said he was seen walking towards the main part of the cemetery. "He then turns around, salutes to the camera and walks away," she told the coroner.
Mr MacThomais was the chief historian and, as a popular tour guide, the face of Glasnevin Cemetery. He also featured in the acclaimed documentary, One Million Dubliners, which was broadcast on RTE.
At his funeral, his death was likened to "a library burning down".
He was last seen in person by his friend Kieran White, who met him on the Cabra Road about a half an hour before he went into the cemetery. He said they walked together for a while and had a general chat.
"He told me he was going for the peace and quiet of the cemetery. He was going to do some writing," he said.
Mr MacThomais was working on the Cumann na mBan centenary at the time of his death.
"He found the cemetery the best place to do it because of the peace and quiet," Mr White said.
His last known communication was a Facebook message posted at 8pm.
The body was found the following day by mourners attending a funeral elsewhere in the cemetery who alerted staff. Grounds manager Philip Ryan, who described Mr MacThomais as a "huge driver behind the whole development of the cemetery", said he realised it was his colleague as he approached the body. He had last spoken to him three days earlier and he was "in good form", he said.
Gda Dolan said a number of letters to family and friends were found on Mr MacThomais's person in the morgue. Coroner Dr Brian Farrell described these as "farewell" notes.
The father-of-one had a history of depression.
Speaking in the court, his mother Rosaleen MacThomais said he had suffered with it since he was six years old and had made a number of attempts at self-harm but none in recent years. He had also overcome a drug addiction.
Dr Farrell said the pathologist has given the cause of death as hanging.
There were toxic levels of painkiller and anti-depressant medication in Mr MacThomais's system at the time as well as a moderate amount of alcohol.
He returned a verdict of death by suicide.