WEST YORK, Pa. — The town council on Monday voted to accept the resignation of the Republican mayor after an uproar over racist posts on his Facebook page, including two depicting apes with captions referring to Democratic President Barack Obama and his family.

One image of a wagon full of orangutans referred to “moving day” at the White House. Another referred to lynching.

The West York borough council last week voted to censure Mayor Charles Wasko, who’s white, but had no power to throw him out of office. It voted unanimously on Monday to accept his resignation.

Democratic Council President Shawn Mauck will take over as mayor.

“I think Mayor Wasko missed a golden opportunity,” Mauck said. “He could have come out and apologized, and that would have been a signature move forward.”

Wasko said he was the victim of a “witch hunt” originating with a fight over the acting police chief in the borough of 4,500 residents about 100 miles west of Philadelphia. But in an interview this month with Harrisburg TV station WHTM he also said: “The racist stuff, yeah. I’ll admit I did that, and I don’t care what people label me as.” He added that he did not regret the posts referencing Obama, the nation’s first black president.

Wasko offered to resign if the borough reinstated the previous police chief, who is on paid leave.

The council had to address Wasko’s conditions but didn’t have to meet them, Mauck said. It took a look at Wasko’s requests and considered them but made no changes to the police chief position, Mauck said.

“Our chief is still the chief,” he said.