When science hits the news, researchers often moan about the quality of the coverage. A sharp reminder of the issue rolls round this month — the anniversary of the global media frenzy over the release of e-mails from climate researchers at the University of East Anglia, UK. So what should scientists do when reporting quality falls off a cliff? Earlier this year, I was seriously misrepresented by a newspaper and thrown into a political storm. Rather than take it lying down, I set the record straight. It has been an odd journey, and I think there are lessons for how we scientists should deal with the media.

In January, the absurd claim from the Intergovernmental Panel on Climate Change (IPCC) that Himalayan glaciers would melt by 2035 launched a hunt to find other exaggerated risks of climate change. A British blogger, Richard North, found an IPCC statement that part of the Amazon rainforest may be at risk from droughts, referenced to an environment group's report, not the scientific literature. North dubbed it Amazongate, and told the world that the IPCC view "seems to be a complete fabrication".

As a tropical-forest expert, I found my telephone ringing for three days. Journalists asked me to comment on the IPCC line that "up to 40% of the Amazonian forests could react drastically to even a slight reduction in precipitation". My short answer was that in context, the statement was broadly correct; but the wording was not careful, and the IPCC should have cited the primary literature. My comments were broadcast across the BBC, but for most news outlets it was a non-story.

The Sunday Times saw it differently. Its reporter, Jonathan Leake, asked both leading and genuinely inquisitive questions. I sent him scientific papers, and we discussed them. He agreed to read the finished piece to me over the telephone before publication. It stated, correctly, that the future of the Amazon is very uncertain, because the available data are limited. I was quietly pleased that I had 'spun' what I saw as a blogger's anti-IPCC tirade into a story about the science. Yet I was wrong. The newspaper headline was "UN climate panel shamed by bogus rainforest claim", and worse, I was the expert quoted to support it. The article had been completely rewritten, essentially parroting North's blog, to include new quotes from me (genuine, but heavily edited and misleadingly taken out of context), and fabricated assertions about my views. An accompanying editorial called for the IPCC chairman to resign.

I was furious. Worse, the two conflicting versions of my views — on the BBC and in The Sunday Times — constituted a serious affront to my professional credibility. But what could I do? I added a comment under the online version of the article that my views were not accurately reported, and sent a letter for publication to The Sunday Times.

Weeks later the misleading article had been reproduced over 20,000 times on the Internet. My letter had been ignored and website comment deleted. Furthermore, my words and standing as an expert were being used by other newspapers to allege widespread corruption by IPCC scientists. As an Editorial on climate disinformation in this journal said at the time: "Scientists must now emphasize the science, while acknowledging that they are in a street fight." I needed to fight back.

Closing the newspaper with a sigh is not enough. ,

After advice from a friend in public relations and press officers at scientific organizations, I filed an official complaint to the Press Complaints Commission, the UK media watchdog. The commission could order the newspaper to print a correction, but would that happen and was it enough? I needed to make the complaint itself a story.

I contacted The Guardian newspaper, which published an article about my complaint. To reach the US audience, I handed the full complaint as an exclusive to perhaps the world's most influential political climate-change blog, Joe Romm's http://climateprogress.org.

For a scientist to take such an active media role was unorthodox, but it felt good. And it worked. It was widely recognized that the story was wrong and I had been badly treated. The New York Times featured me in a front-page article.

The Sunday Times offered to publish a single-line apology. I knew others had extracted greater concessions and kicked harder. It eventually agreed to remove the article from its website, and replace it with a formal correction and apology, also printed prominently in the newspaper. The retraction was reported around the world.

Environmental commentators hailed the apology as vindication for the IPCC (which it wasn't quite, as its statements were not faultless). Climate sceptics launched a counter-attack by claiming that no apology was due because the IPCC statement was not perfect. But for me the storm had passed.

What lessons are there for scientists in politically charged areas who find themselves in a similar position? Do your research. What is the reporter's track record? Anticipate that every sentence you say or write may be dissected and interpreted in the least charitable manner possible. And if things go wrong, seek advice from public-relations experts, and where necessary, media lawyers. In my experience, science-media professionals are almost as lost as scientists themselves, when dealing with topics as emotive as climate change.

The media dictate what most people know about contemporary scientific debates. Given the need for informed policy, scientists need to learn to better read and engage with this media landscape. Closing the newspaper with a sigh is not enough.