Comedian Matt Lucas thanked fans for their support but announced he would be leaving Twitter after a user posted a joke about his ex-partner’s death.

Lucas had entered a civil partnership with Kevin McGee in 2006. It was dissolved in 2008 on the grounds of McGee’s unreasonable behaviour.

McGee went on to hang himself in his Edinburgh flat in 2009.

The joke in question, which was deleted, was posted to Twitter by user @oOfuscoOo, whose account is no longer live.

After seeing the tweet, Lucas wrote to him “Shame on you”.

The user, who is reported to be 16, wrote back with an ;D emoticon.

Lucas replied: “I’m not joking. I think you should delete that tweet. It really upset me.”

He added: “I’m disappointed that @oOfuscoOo thinks jokes about the suicide of my former partner are funny.

After the joke Lucas wrote on the site on Saturday: “I appreciate all the support on here over the past couple of years but it’s time to shut down my Twitter account.”

The user subsequently tweeted to Lucas: “I never actually sent this to you. I only put it up as a joke for my friends to see. I didn’t mean to be a c**t sorry Matt.”

It is not known whether Lucas would have seen this as the account which sent it now appears to have been deactivated.

Lucas has vigorously pursued inaccuracies in the press following McGee’s death. In 2010, he accepted undisclosed damages from the Daily Star over articles published in the paper McGee’s death.

It was heard in the High Court that the paper had published unfounded articles alleging Mr Lucas had been placed on suicide watch and that his relationship with Mr McGee had been in trouble owing to the latter’s cocaine use.

Daily Mail columnist Jan Moir drew comparisons between McGee’s death and that of Stephen Gately in her infamous 2009 column on the latter’s accidental death.

Users have been posting messages with the hashtag #TwitterlovesyouMattLucas to encourage the much-loved star, who has 568,000 followers, to return.