An unflattering picture of François Hollande has sparked an internet storm in France after being leaked to Twitter.

In the image - which the main French news agency AFP attempted to withdraw from circulation - the French president looks gormless as he grins in front of a blackboard on which is written: "Today, it's back to school".

The photograph was taken on Tuesday during Mr Hollande's visit to a school in Denain, northern France, to coincide with the start of term for hundreds of thousands of French pupils. It appears he was pulling a funny face to make the pupils laugh.

The original image came with the caption: "During a visit to the school Denain Michelet, September 3, 2013, Francois Hollande smiles, chairing a panel discussion on the reform of school timetables established by the government."

AFP initially posted the picture on its website as available for downloading but – apparently concerned it was inappropriate for a head of state – both later issued a "mandatory kill" notice, meaning the photo must not be used.

AFP wrote: "Due to an editorial decision this photo has been withdrawn. Please remove from all your systems. We are sorry for any inconvenience and thank you for your cooperation."

Despite the ban, however, the image quickly hit social media sites like Twitter, and sparked a flurry of comments.

One wrote: "Here is the new official photo of François Hollande. Please put up in all town halls!"

Another wrote that no amount of Photoshop editing software "can make the president look more intelligent".

A third, in a slightly subtler dig at plans to raise the state pension age, suggested Mr Hollande was thinking: "How can I tell them they're going to have to retire at 80?"

Once renowned as being one of France's funniest politicians with a knack for the bon mot, Mr Hollande has toned down his humour since becoming president, to accord more closely with the gravitas of his status as French head of state.

Quizzed by French media, AFP insisted it had come no pressure from the Elysée Palace to withdraw the photo, which continued to be available through Reuters on a pooled basis.

Agencies withdrawing photos of public figures is very rare in France, hence the questions over why a state-funded agency like AFP would attempt to withdraw the image at a time when Mr Hollande wants to appear solemn over Syria and is commemorating the Nazi war atrocity of Oradour-sur-Glane.

Philippe Massonnet, news director at AFP, said: "Has this photo been withdrawn because the Elysée intervened to ask us to do so? The answer is no, that's absolutely clear."

Le Point magazine's website said the French president appeared to be the victim of the so-called "Streisand effect", which Wikipedia defines as "the phenomenon whereby an attempt to hide, remove, or censor a piece of information has the unintended consequence of publicising the information more widely, usually facilitated by the Internet".

Mr Massonet said the decision to "kill" the photo was made after an "internal debate" among editorial staff due to the initial buzz the photo had created on Tuesday.

"It was decided to kill the photo as we considered in retrospect that it provided nothing in news terms." The agency then published another photo from the series in which the president's smile looks slightly less clownish.

Mr Massonnet said such decisions were taken "daily".

"There are choices to be made. In war photos, for example, we can decide not to broadcast bloodthirsty or degrading images," he told Nouvel Observateur website.

In his defence, he added: "Unlike certain media, when we make a mistake, we correct it. We make modifications to our copy and we 'kill' our photos. But this case remains exceptional, even more so when it concerns a photo of a (figure of) authority."