Beverly Whaling, the mayor of Clay, West Virginia, resigned on Tuesday (15 November) following an uproar over her response to a racist comment posted on Facebook that described US First Lady Michelle Obama as an "ape in heels".

The council of the town accepted Whaling's resignation and said it would act immediately to name a replacement for the remaining three years of her term, local television channel WSAZ reported.

The controversy arose when Pamela Taylor, the director of Clay County Development Corporation, put up a Facebook post that said: "It will be so refreshing to have a classy, beautiful, dignified First Lady back in the White House. I'm tired of seeing a Ape in heels." Whaling responded to the post, with, "Just made my day Pam".

The posts were later deleted and the women's Facebook pages were taken down, according to local media reports.

Clay councilman Jason Hubbard released a statement saying: "I'd like to apologize to anyone who was offended and most certainly the First Lady. I'm sorry that this happened."

"The Town Council would like to condemn the horrible and indecent post that is the centre of the controversy. This post is an individual and isolated act. This kind of racial intolerance is not what this community is about", he added.

West Virginia Democratic Party chairwoman Belinda Biafore had also apologised to first lady Michelle Obama in a statement: "On behalf of my fellow Mountaineers I would like extend my sincerest apologies to First Lady Michelle Obama. West Virginia truly is better than this. These radical, hateful, and racist ideals are exactly what we at the West Virginia Democratic Party will continue to fight against."

The racial slur posted by Taylor and the mayor's response triggered an online petition drive to have the two women sacked. The petition garnered almost 160,000 signatures from people across the country.

On Monday, Whaling had apologised in a statement, which read: "My comment was not intended to be racist at all. I was referring to my day being made for change in the White House! I am truly sorry for any hard feeling this may have caused! Those who know me know that I'm not in any way racist!"