Image copyright ABC NEWS Image caption The customer's first order - a Confederate battle flag cake - was rejected

Walmart has apologised after a store in Louisiana in the US made a sheet cake decorated with the Islamic State flag.

Chuck Netzhammer initially requested a cake decorated with a Confederate battle flag and the words "heritage not hate", but the store refused.

Mr Netzhammer then placed an order for a cake topped with the banner of the militant group.

Walmart said the worker who took the order was unfamiliar with the design of the Islamic State (IS) flag.

Mr Netzhammer has posted a video showing the cake on YouTube.

"That's an Isis battleflag cake that anybody can go buy at Walmart," Mr Netzhammer said in the video, using another term for the militant group. "But you can't buy a Confederate flag toy."

The Confederate battle flag has become a contentious issue in the US after nine black churchgoers were shot and killed earlier this month in Charleston, South Carolina.

Police believe the shooting was racially motivated and the suspect, Dylann Roof, appears in several photographs posing with the Confederate battle flag.

The tragedy has reignited debate about race relations and sparked a backlash against the Confederate flag.

Walmart and several other US companies including Amazon and eBay have stopped selling Confederate flag products in response to the controversy.