A minor revolution happened in Britain this week. Never in recent history have those infamous arbiters of popular opinion, the red-top tabloids, suffered such convulsions. Never have they lost, so critically, their surefootedness.
The cause of their discomfort was homosexuality and the place of gay people in public life.
A strong strain of homophobia has long run through our conservative and tabloid newspapers. Gay and lesbian people have been baited, harried and vilified. The pop singer, Elton John, the writer and broadcaster, Russell Harty, the footballer, Justin Fashanu; the list of public figures who have had their private lives dredged through simply because they were gay is a long one.
But you don't need to have been famous to have been targeted. "Pulpit poofters" was Rupert Murdoch's Sun headline for a report "exposing" gay priests. Teachers, members of the armed forces, yes, even politicians, nobody has been spared.
Meanwhile, the real world has moved on. Thirty years after the decriminalisation of homosexuality, hundreds of thousands of ordinary gay and lesbian people lead quite normal, happy, open lives in all areas of society. They have parents, brothers, sisters, colleagues who work with them and appreciate them. More and more people know somebody who is gay and know that the image of gay people peddled by their newspapers is a caricature built on prejudice.
Gay characterisation in the popular soap operas has confirmed people's positive experience of gay people in real life and contrasted with their depiction in the tabloids as freaks, perverts and child molesters.
Things have been said about gay and lesbian people that would have been unacceptable, even illegal, if they had been said about racial, religious or other minorities.
This week, after a series of dizzying convolutions, the papers said sorry. In doing so, they acknowledged they had badly misread their own readers. Last week, following the outing (again!) of Peter Mandelson on BBC TV's Newsnight by the gay former Tory MP turned newspaper columnist, Matthew Parris, a Sun editorial took us all by surprise by declaring that the Trade Secretary's sexual orientation was irrelevant. He was a wonderful guy, doing a brilliant job. That was all that mattered.
Then on Sunday the Sun's Murdoch stablemate, the News of the World, outed the Agriculture Secretary, Nick Brown. A popular and highly effective minister, there was no suggestion he had done anything wrong or was guilty of hypocrisy or that his private life conflicted in any way with his public role.
On Monday, as if to defend the behaviour of its sister paper, the Sun screamed on its front page for Tony Blair to come clean about the "gay mafia" at the heart of British public life. In politics, the police, the judiciary - everywhere except in the editorial offices of the Sun - gay cabals were busy scheming and plotting the downfall of civilisation as we know it.
In the space of a few days, Britain's bestread newspaper had flip-flopped from hating gays and loathing "outing" to quite liking some gays and loving "outing". The Sun's leftwing rival, the Mirror, sensing blood, accused its rival of confusion mixed with prejudice. The Mirror's view was that gay MPs would be better off coming out, but that it should be a matter for them.
On Tuesday, sounding less sure of itself than ever, the Sun's front page shrieked "Blair backs Sun on gays". This was a complete fabrication and infuriated Downing Street. Bizarrely, on the same day the Mirror changed its mind and agreed with Monday's Sun that voters did have a right to know the sexual orientation of their politicians.
But it didn't sound sure enough and invited its readers to ring in on the subject. That poll caused yet another change of heart, as an overwhelming majority of Mirror readers said they were not interested in the sexual orientation of MPs and believed they deserved a private life.
Wednesday's Mirror reverted to its original, more tolerant stance, Wednesday's Sun was completely silent. Then on Thursday came the Sun's ground-breaking apology. "We will not invade the privacy of gay people . . . We recognise that public attitudes are changing . . . Our readers are tolerant of private behaviour and find unwarranted intrusion offensive." As if for good measure, the Sun sacked its "outing" columnist, Matthew Parris. Why they didn't sack another columnist, the obnoxiously homophobic Richard Littlejohn, instead escapes me. A sign perhaps that the "apology" was not as heartfelt as it seemed. There are reports of mutinous Sun executives and even Murdoch himself forcing the apology out of reluctant editors.
But why did it take the papers so long to realise they were wrong? The tabloids pride themselves on their antennae. They are usually quick to pre-empt, predict and lead shifting attitudes in their readers. Why did they not realise that their prurience, prejudice and puritanism lagged so far behind? The evidence was there staring them in the face, in opinion polls and in real election results.
In the May 1997 election I stood in Exeter, archetypal "middle England", as the first candidate who had been openly gay from the beginning, against an extremely homophobic Conservative. I achieved the best swing to Labour in the south-west. Chris Smith became the first openly gay member of the Cabinet. There was Stephen Twigg trouncing Portillo, Angela Eagle rapidly promoted. Since then I've lost count. Not a gay mafia, but politicians who happen to be gay, as others happen to be left-handed or have brown eyes, simply doing a good job.
I can only conclude that the newspapers didn't change because they didn't want to change. Their editors were too consumed by their own prejudices to set their minds free. It was once said of Murdoch that he never lost money underestimating the British public. This time his and other papers have underestimated them and have paid the price, if not in pounds, then in uncharacteristic muddle and grovelling apologies. Things will never be quite the same again.