Scott Falconer, 20, Bruce Owens, 19, and Cameron Henry, 17, spray painted comments including "brotherhood" and "white power" on a number of headstones at the Necropolis cemetery in Glasgow.
Gardeners found the vandalism when they turned up for work and spotted the graffiti, including phrases and swastikas drawn on a number of headstones and some that had been toppled over and broken.
The damage to the 18 headstones that were broken or defaced during the graffiti spree was £40,000.
The police were contacted and after receiving an anonymous email with pictures attached showing the accused at work, they investigated through Facebook and tracked the three men down.
Falconer, from Kilbarchan, Renfrewshire, and Henry, from Carluke, North Lanarkshire pled guilty at Glasgow Sheriff Court to maliciously spray painting racist remarks and slogans on various headstones between July 15 and July 17, 2011.
Owens, from Cranhill, Glasgow, admitted the same offence as well as kicking over and damaging headstones.
Procurator fiscal depute Derek Buchanan told the court that two gardeners went to the grounds on July 17, to start their shift around 9am.
He said one headstone displayed the words 'white power', the second had 'dubba' and the third headstone had 'punks dead ha'.
Several headstones also had swastikas spray painted on them.
The gardeners went to another area of the graveyard and saw the same damage on a number of headstones.
Sheriff Alayne Swanson deferred sentence on all men until next month and bail was continued.