Shannon Dildine
The photo of officer Shannon Dildine appeared online following the Charlestown shootingFacebook

A North Charleston police officer has been fired after a photo of him wearing Confederate flag boxer shorts appeared online.

Shannon Dildine was dismissed from the North Charleston force for smiling while wearing the underwear with a pattern which "symbolises hate and oppression".

Dildine, who was a sergeant and with the force since 1996, is said to have 10 days to appeal against the decision.

The sacking comes after increasing calls for the Confederate flag to be removed from state grounds in the wake of the Charleston black Church shooting in which nine people died.

The suspected gunman, Dylann Roof, is a white supremacist who has been linked to an online manifesto calling for a "race war" and has been photographed posing with the flag.

In a letter seen by ABC News, Police Chief Eddie Driggers told Dildine: "Your posting in this manner led to you being publicly identified as a North Charleston Police officer and associated both you and the department with an image that symbolizes hate and oppression to a significant portion of the citizens we are sworn to serve."

The letter added that the photo, which was uploaded to Facebook, could be damging in any future cases "since defense counsel can reasonably be expected to use the photograph to call into question your motivation in making the arrest.

"In light of current events posting an inflammatory photograph in a way that permitted it to become widely distributed shows a lack of reason or judgment that is unacceptable."

Following the Charlestown shooting, several high profile names such as Amazon, Walmart and eBay announced they will no longer be selling any Confederate Flag merchandise.

Apple also said it has pulled all its iOS apps and games which feature the flag in "offensive or mean-spirited ways".