At a funeral for Shay Bradley in Kilkenny, Ireland, over the weekend, he pranked his loved ones with a message from beyond the grave.

As Bradley's coffin was lowered into the ground, a recording of him said "Hello? Hello? Let me out! Where the f--- am I?" and "Let me out! It's f---ing dark in here!"

An obituary for Bradley said he died "after a long illness."

His daughter Andrea Bradley told HuffPost that her father recorded the audio about a year ago in preparation for his death.

She said his dying wish was to have the recording played during his funeral.

Visit Insider's homepage for more stories.

A man in Ireland got the last laugh at his funeral by pranking mourners with a message from beyond the grave.

Loved ones attending the funeral of Shay Bradley, a veteran of Ireland's Defence Forces, were shocked when they heard his voice as his coffin was lowered into the ground in Kilkenny.

"Hello? Hello? Let me out! Where the f--- am I?" a prerecorded message from Bradley said.

"Let me out! It's f---ing dark in here!" he continued.

"Is that that priest I can hear?" he said, adding: "This is Shay. I'm in the box. No, in f---ing front of you. I'm dead."

Bradley then began singing "Hello again, hello. I just called to say goodbye."

Watch the video of the prank:

An obituary for Bradley published by Fanagans Funeral Directors said he died last week "after a long illness."

His daughter Andrea Bradley told HuffPost that her father's dying wish was to have the audio recording played during his funeral.

She said that her father recorded the audio about a year ago and that only her brother and her nephew knew about it. Days before the funeral, her brother told the rest of his siblings and their mother about the prank.

Read more: A YouTuber tricked influencers into thinking they'd been sent pieces of the moon, but it was gravel

"He wanted to make sure my mam would be laughing leaving the cemetery, not crying," Andrea Bradley told HuffPost, adding that her parents were married for 43 years.

She said her father's recording was a way of "saying not only goodbye but to also say, 'OK, the sadness is over now — here is a laugh so you can go and celebrate my life with a smile on your face.'"