Balbriggan District Court heard how Sean Cullen (23) was under the influence of drugs as he followed a woman on a summer evening and slapped her.
He admitted that he carried out the assault "to get a thrill" and because "she had a nice bum".
Cullen, of Ashton Avenue, Ashton Brock in Swords, pleaded guilty to sexual assault on July 26, 2011, at Drynam Road, Swords.
Judge Dermot Dempsey said that a jail sentence could not be avoided, despite a plea by his defence lawyer Fiona Darcy for community service.
The judge said Cullen's victim endured a "terrifying ordeal".
He imposed an eight-month prison sentence but released Cullen on his own recognisance of €400 and independent surety of €200 after Cullen immediately lodged an appeal to the sentence.
Cullen was arrested by gardai on December 12, 2011, and told gardai he "slapped her on the ass to get a thrill".
"He says it won't happen again," said Ms Darcy. "He has learnt his lesson to stay away from drugs."