Mayor Beverly Whaling of Clay, a town of some 500 people about 25 miles (42 km) northeast of state capital Charleston, came under fire for her reaction to the post from a development official following Republican Donald Trump's victory in last week's presidential election.
Pamela Ramsey Taylor, director of Clay County Development Corp, praised the shift from Obama to former model Melania Trump. According to Charleston's WSAZ TV, she wrote: “It will be refreshing to have a classy, beautiful, dignified first lady back in the White House. I’m tired of seeing an ape in heels.”
Whaling responded: "Just made my day Pam."
The posts were deleted, according to local reports, but circulated widely on social media.
Whaling handed in her resignation, the Charleston Gazette-Mail said, citing city councilman Jason Hubbard. WSAZ also reported her resignation.
A woman who answered the phone at the Clay County Development Corp, a government-funded nonprofit, confirmed Whaling's exit, saying she had seen the resignation letter.
Taylor resigned on Friday, said the woman, who declined to give her name.
Calls to the mayor's office went unanswered.
An online petition calling for the women's ouster drew 150,000 signatures as of Tuesday afternoon.
Whaling apologised in a statement sent on Monday to The Washington Post, saying her comment was not intended to be racist.
"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!" she wrote.