A former Greek serviceman was warned he faced a significant jail sentence after he left a potentially explosive device bearing the slogan "F*** you all" in city centre public gardens.
Nikolaos Karvounakis claimed to be a member of the International Terrorist Mafia - a Mexican eco- terror group - after placing the homemade 'bomb' in Edinburgh's Princes Street Gardens.
About a month after the device was found he contacted a newspaper journalist sending a photo of it and described himself as a "lover of nihilist anti-political violence".
The High Court in Edinburgh heard that Cretan-born Karvounakis, 35, completed his national service in the Greek Army before moving to Scotland in 2013.
Advocate depute Angela Gray said: "On January 11 2018 at 5pm a group of City of Edinburgh Council staff were made aware by a member of the public of a cardboard box containing what appeared to be a 'bomb' device in one of the shelters in Princes Street Gardens.
"On inspecting the item further, staff found it to contain a black pipe, wiring and a battery taped to the inside of the box with the word 'f**k you all' written on the internal surface of the lid flap," said the prosecutor.
She told the court: "The device was later established to contain the component parts of a potentially viable device.
"Had it detonated, it would have the potential to cause significant injury to persons and damage to property in close proximity as a result of the metal pipe or metal nails that were within it being propelled outwards from the explosion."
A total of 58 nails, some of which had been cut in half, were found inside the item.
Ms Gray said the finding prompted a major operation by the emergency services and armed forces ordnance disposal experts were called in. A controlled detonation was carried out.
She said: "After the discovery of the device in 2018 Police Scotland made extensive efforts to identify who was responsible. Their investigations led to the accused."
The prosecutor said investigations were conducted in the UK and abroad and intelligence was received which focussed the enquiry on Karvounakis.
Police discovered that he had bought the parts used in the construction of the device from DIY stores and over the internet.
Explosives experts found that he had quite closely followed an instructional video he referenced to build it.
The court heard that Karvounakis maintained that a fuse was inserted into a modified bulb to give the appearance of an improvised igniter but the fuse was not actually connected to the filament.
But scientists who examined the equipment cautioned that there remained a risk that it could still prove viable due to the potential introduction of a hot filament wire in close proximity to a low explosive substance.
A total of 71g of low explosive powder was found made up from match heads and sugar.
Karvounakis was arrested in the early hours of June 15 in 2021 by counter terrorism firearms officers at North Bridge, in Edinburgh, in connection with a terrorism offence and said: "I don't understand. Is there any evidence of this?"
The court heard that his DNA was found on adhesive tape in the device placed in the gardens.
Ms Gray said: "Nikolaos Karvounakis manufactured and positioned it in Princes Street Gardens, Edinburgh, where it was discovered on January 11 in 2018."
Karvounakis admitted possessing the device containing explosive material in circumstances giving rise to reasonable suspicion that he had it "for a purpose connected with the commission, preparation or instigation of an act of terrorism".
The former cleaner, of Granton Road, in Edinburgh, held a variety of jobs since arriving in Scotland in 2013. He has indefinite leave to remain in the UK.
Ms Gray said that in February 2018 he sent an email to a newspaper reporter headed 'International Terrorist Group in UK'.
It contained a link to an eco-extremist website where he anonymously claimed responsibility.
He signed off as 'Misanthropos Cacogen' and claimed to be a member of the 'International Terrorist Mafia'.
The prosecutor said: "This is known as ITS, an abbreviation of a Spanish phrase translating to 'individualists tending the wild'.
"This Mexican terrorist organisation was formed during 2011. The group focuses on eco-terrorism, which involves acts of violence against people and/or property in support of environmental causes."
Defence counsel John Scullion QC said: "The accused's position is that he intended to cause disruption but not physical harm and when the device was left in the gardens it was not set to detonate."
"The accused wrote a message inside the box which was intended to be read and was intended to cause alarm when the box was opened", he said.
Mr Scullion said he wished to apologise for his actions and had prepared a letter of apology for the court.
The defence counsel said "a significant sentence of imprisonment" was inevitable following the guilty plea to an offence under the Terrorism Act.
The judge, Lord Braid, told Karvounakis: "As has been acknowledged on your behalf a significant custodial sentence will be inevitable in this case."
The first offender was told he will be remanded in custody while a background report is prepared on him ahead of sentencing next month. The Crown has made a move to have him placed on a serious crime prevention order.