A graveyard maintenance worker stole a man's bank card and used it to buy breakfast after drinking with the victim, who fell asleep.
Darren Fortune (43) was with a group of people who spent the night together after meet- ing at a club before ending up at a church, where he took the card.
Judge Ann Ryan ordered him to carry out 100 hours of community service to avoid a jail sentence.
Fortune, a father-of-three living at a hostel on Oakley Road, Ranelagh, pleaded guilty to stealing the man's bank card at St Mary's Church, Crumlin, last December 9.
He also admitted obtaining services by deception at Deli- Licious, Lisle Road, Crumlin, on the same date.
Dublin District Court heard the victim met four people in a nightclub and ended up with two of them at St Mary's Church.
The victim fell asleep, and when he woke he found his bank card was missing.
Gardai learned it had been used in a transaction at Deli- Licious and viewed CCTV, which identified the accused.
The court heard Fortune had previous convictions for offences including theft.
"Alcohol had a large part to play in relation to the matter," defence barrister Joseph Mulrean said.
The theft happened the morning after the men had been drinking together.
The accused was spotted on camera at the restaurant using the card to buy breakfast not far from where the theft happened, Mr Mulrean said.
Fortune had worked on a community employment scheme in graveyard maintenance, the court heard.
He had been under the influence of alcohol at the time of the theft and was very apologetic for what had happened, Mr Mulrean said.
It was borne out of drunkenness and he was very sorry for it.
Fortune accepted it was a "terrible thing to do" and he was ashamed.
Judge Ryan noted that although the accused had admitted the offences, it had been a "very late plea" of guilty after he had initially entered pleas of not guilty.