Facebook Inc has reversed its decision to remove an iconic Vietnam War photograph after an attack from the Norwegian prime minister, who said the photo "shaped world history".

The social media giant on Friday erased the photograph, which shows a naked girl fleeing a napalm attack, from the Facebook pages of several Norwegian authors and media outlets, but later reversed its decision after mounting public criticism.

While the company initially said the picture violated it's community standards against nudity, in a short statement released late on Friday, it recognized "the history and global importance of this image in documenting a particular moment in time".

Captured in 1972 by Pulitzer Prize-winner Nick Ut of the Associated Press, the image of screaming children running from a napalm attack shows a naked nine-year-old girl, Kim Phúc, at its centre.

The controversy started when Facebook deleted a post by Norwegian writer Tom Egeland that featured Nick Ut's Pulitzer-winning photograph on Monday on the grounds of "nudity".

Egeland’s post discussed seven photographs that changed the history of warfare. He was subsequently suspended from the social media site.

Facebook: Social media platform or news gatekeeper?

In protest, many Norwegians posted the photo on their own Facebook pages.

On the same day, Norway's flagship national daily, Aftenposten, reported on Egeland's suspension using the same photograph and shared the article on its Facebook page.

The newspaper immediately received a message from Facebook asking it to "either remove or pixelate" the photograph.

In response, Aftenposten splashed the photograph across the front page of its newspaper and website on Friday next to a large Facebook logo, and wrote a front-page editorial headlined "Dear Mark Zuckerberg", arguing that the network was undermining democracy.

'Facebook gets it wrong'

Norwegian Prime Minister Erna Solberg then posted the photograph on her own Facebook profile, writing that it had contributed to change the course of world history.

"Facebook gets it wrong when they censor such pictures. It limits the freedom of speech," Solberg wrote. "I say yes to healthy, open and free debate - online and wherever else we go. But I say no to this form of censorship."

Solberg, in her post, also praised Facebook for combating pictures of child abuse. Aftenposten, in its editorial, said Facebook should be able to tell the difference between child pornography and famous war photography.

The image and the accompanying post later disappeared from the prime minister's Facebook page.

Solberg responded to Facebook's decision to erase her post by sharing a censored version of the "napalm girl" photo and a series of other iconic news photographs.

"While I was on a plane from Oslo to Trondheim, Facebook deleted a post from my Facebook page," she said.

"What Facebook does by removing images of this kind, good as the intentions may be, is to edit our common history."

Speaking to Al Jazeera from Norway, Solberg said that this sort of censorship was unacceptable.

"I have praised Facebook on the fact that they are very firm on the stance that pornography, child abuse and violence shouldn't be shown on the platform. But you can't let machines run everything. You can't let machines run your morality or distort your history," the prime minister said.

"That means that Facebook needs to have a system that recognises that there are iconic pictures, or situations in which machines cannot decide to just take the images away," Solberg added.

Facebook said in a statement earlier in the day on Friday that its rules were more blunt than the company itself would prefer, adding that restrictions on nudity were necessary on a global platform.

"While we recognise that this photo is iconic, it's difficult to create a distinction between allowing a photograph of a nude child in one instance and not others," a company spokesperson wrote.

"We try to find the right balance between enabling people to express themselves while maintaining a safe and respectful experience for our global community. Our solutions won't always be perfect, but we will continue to try to improve our policies and the ways in which we apply them."