(Reuters) - The mayor of a small Pennsylvania town is resigning after sparking outrage by posting images on his Facebook page comparing President Barack Obama and his family to apes and referencing a noose.

The council of the borough of West York, located about 100 miles (160 km) west of Philadelphia, voted unanimously on Monday to accept Mayor Charles Wasko’s offer to step down, council President Shawn Mauck said.

Wasko’s resignation will become effective on Oct. 21, and Mauck will fill out the rest of the mayor’s term, which runs until Dec. 31, 2017, Mauck said in a telephone interview on Tuesday.

Wasko could not immediately be reached for comment.

Wasko had resisted calls to step down earlier this month, after he was accused of racism for the images on his page. The West York Borough Council voted 7-0 on Oct. 3 to censure him over the posts.

Mauck said he feared the episode had damaged the community’s economy and that he wanted to repair its reputation.

“We’re going to move forward together to do everything we can to help the community heal,” he said.

Wasko posted an image in June of five orangutans in a wheelbarrow with the caption, “Aww... moving day at the Whitehouse has finally arrived.”

Another image showed actor Clint Eastwood holding a noose in a scene from a Western movie. The image carried the caption, “Barry, this rope is for you. You wanna bring that empty chair over here!” Obama used Barry as a nickname when he was young.

Nooses were used for decades in the lynchings of black people by white supremacists in the segregated U.S. South.

There have been other instances across the country of public officials spreading racist images and jokes since Obama took office in 2009 as the first black U.S. president. For example, a federal judge in Montana retired in 2013 after acknowledging that he had used court email to circulate a racist joke about Obama.