He didn't have to do it. That's one reason he's still admired

When the Dixie Chicks told an audience in London in 2003 that "We're ashamed the president of the United States is from Texas", they set off a political storm in the US that echoed the treatment meted out to John Lennon 30 years earlier. They were talking about the Iraq war, while Lennon had been campaigning against the Vietnam war.The Dixie Chicks got in trouble with rightwing talk radio. Boycotts followed, and lead singer Natalie Maines ended up publicly apologising to President Bush.

What happened to Lennon was of course worse. The turning point for the Beatles came with their 1966 US tour, when they first publicly criticised the war in Vietnam. As the decade wore on, Lennon was the target of increasingly aggressive media ridicule, especially when he began experimenting with new forms of political protest - such as declaring his honeymoon with Yoko Ono a "bed-in for peace".

In the next couple of years, establishment hostility turned nastier on both sides of the Atlantic, as the former Beatle embraced more serious radicalism, making common cause with Tariq Ali (then editor of the Marxist Red Mole). In 1971, Lennon joined a march in London against internment without trial in Northern Ireland and helped fund the republican cause. By the time he left for New York that autumn, the knives were out.

In the late 60s, Lennon had been busted for cannabis possession. He claimed it had been planted by the police, but pleaded guilty to a misdemeanour charge. Within months of his joining the US anti-war movement and publicly attacking President Nixon, the US administration responded with deportation proceedings. Nixon claimed that Lennon had been ineligible for admission to the US because of the cannabis conviction in London, but everybody understood the deportation order was an attempt to silence him as a critic of the Vietnam war and the president.

Lennon's case illuminates the price pop stars and other celebrities can pay for taking controversial political stands - particularly when they oppose American wars. Every pop star needs a cause, but it has to be one that doesn't offend the powers-that-be - landmines, or hunger, or Aids in Africa. Lennon's example is almost unique. Charlie Chaplin was driven out of the US after being charged with communist sympathies at the height of the McCarthy era, but such examples are rare.

What exactly had Lennon done? It wasn't just singing Give Peace a Chance - it was when and where he sang it; 1972 was an election year, Nixon was running for re-election and the Vietnam war was the key issue. Lennon was talking to anti-war leaders about doing a tour that would combine rock music with anti-war organising and voter registration. That was the key, because it was the first year 18-year-olds had been given the right to vote. Young voters were assumed to be anti-war, but also known to be the least likely of all age groups to vote. Lennon and his friends hoped to do something about that. Nixon found out about the former Beatle's plans, and the deportation order followed.

The threat was effective. Lennon's lawyers told him to cool it and the tour never took place. Nixon won in a landslide, and the war in Vietnam went on for three more blood-soaked years. Lennon spent the next couple of years facing a 60-day order to leave the country, which his lawyers kept getting postponed.

The striking fact is that Lennon could have avoided all of this. He didn't have to campaign against Nixon. It didn't sell records or help his career. But Lennon wanted to use his power as a superstar to do something worthwhile. And the great issue of the day was the unjust and disastrous war in Vietnam.

In some ways Lennon was naive. When he moved to New York, he thought he was coming to the land of the free. He had little idea of the power of the state to come down on those it regarded as enemies. His claim that the FBI had him under surveillance was rejected as the fantasy of an egomaniac, but 300 pages of FBI files, released under freedom of information after his murder, show he was right. The FBI is still withholding 10 documents - which we hope will finally be released today - on the grounds that they contain "national security information provided by a foreign government": almost certainly MI5 documents on Lennon's radical days in London.

Lennon never apologised to the president. He fought back in court to overturn the deportation order. But in the year after Nixon's re-election, Lennon's personal life fell apart and his music deteriorated. In the end, Nixon resigned in disgrace after Watergate, and Lennon stayed in the US.

For 30 years the idea of a tour combining rock music and voter registration languished - until 2004, when a group of activist musicians organised an election-year concert tour of battleground states with a strategy very much like Lennon's. Headlining the Vote for Change tour were the Dixie Chicks.

For young people in 1972, it was thrilling to see Lennon's courage in standing up to Nixon. That willingness to take risks with his career, and his life, is one reason why people still admire him today.

Jon Wiener, the author of Gimme Some Truth: The John Lennon FBI Files, and served as historical consultant on the film The US v John Lennon, released last week.