For some, it was the photo that took the cake. Former Newcastle mayor Jeff McCloy, who has admitted giving illegal donations to state MPs, has apologised for posing with a birthday cake shaped like a brown paper bag overflowing with cash.

Social media lit up on Sunday night after The Lucky Hotel in Newcastle, owned by Mr McCloy, posted an image of the grinning former mayor and his cake on its Facebook page. The photos were hastily removed.

The property developer resigned as Newcastle mayor in August after admitting at the Independent Commission Against Corruption to giving envelopes stuffed with $10,000 in cash each to former Hunter Liberal MPs Tim Owen and Andrew Cornwell before the last election, as well as a smaller sum to Swansea MP Garry Edwards. Some of the cash was handed over in his luxury Bentley.

It has been illegal for property developers to make political donations in NSW since January 1, 2010.

In a statement on Monday, Mr McCloy apologised for what he described as the "bad judgement" of one of the guests at his surprise birthday party who provided the cake.