Cover of The Earth MovesIt is the defining folk image of the clash between science and religion. Galileo, head bowed, sits before the Roman Inquisition, an old man, tired and broken by torture. Yielding to irresistible pressure, he recants his heretical view that the Earth goes around the Sun rather than is stationary at the centre of the Universe, as taught by Aristotle and, most significantly, the Church. Then, as he shuffles away to imprisonment, he mutters, in defiance of his ecclesiastical tormentors: "E pur si muove!" ("And yet it does move!").

How much of this is true? Surprisingly little, says Dan Hofstadter in his fascinating book The Earth Moves.

Galileo Galilei was a genius. Of that there is no doubt. He discovered that the period of a pendulum is independent of the size of its swing, reputedly by comparing the duration of the swing of the bronze chandelier in the cathedral in Pisa with the regular throb of his own pulse. He deduced the laws governing falling bodies by timing them as they slid down gently inclined planes, effectively diluting gravity so he could observe its effect in slow motion. But it is his observations with a telescope for which he is most celebrated.

Learning of the invention of a magnifying device containing a convex and a concave lens by the German-Dutch lens maker Hans Lippershey in 1608, Galileo threw himself into the construction of his own version. Recognising that its magnification depended crucially on the ratio of the "focal" length of the main, "objective", lens to the focal length of the "eyepiece", he rapidly evolved a telescope which could make distant objects appear 30 times bigger. He immediately turned it on the heavens.

Galileo was not the first to sweep a telescope across the night sky or even to draw what he saw. The credit for that goes to the Englishman Thomas Harriot, who sketched the crater-strewn Moon in the summer of 1609. But Galileo was a supreme publicist - not to mention an artist and communicator - and it was his book The Starry Messenger, published in Venice in spring 1610, that set the intellectual world of 17th-century Europe on fire.

Like Harriot, Galileo discovered that the face of the Moon, long equated with the Virgin Mary, was not perfect, but sullied by craters and mountain chains. He witnessed the planet Venus go from crescent to full and back under changing illumination from the sun. And he discovered that the planet Jupiter was orbited by four moons, irrefutable evidence that not all bodies circled the Earth.

Galileo was already convinced by Nicolaus Copernicus's idea that the Sun and not the Earth was the fixed point about which the planets revolved. His observations provided powerful support for the idea, though they were still just about compatible with the Ptolemaic idea in which the Sun and planets described weird "epicyclic" circles within circles about completely empty points in space. Nevertheless, Galileo felt confident enough to present the merits of the Copernican view in his book Dialogue on the Two Chief World Systems in 1632. It was a fatal mistake.

Galileo was aware of the Catholic Church's 1616 edict against the Copernican worldview. So he carefully concocted a fictional debate between adherents of the various world systems, purporting to be even-handed but favouring the evidence-based Copernican view. A devout Catholic, he even had the book approved by the Vatican.

It was to no avail. In 1633, Galileo, a frail old man of 69 who had to be carried in a litter, was forced to make the arduous journey from Florence to Rome. He was never actually tortured by the Roman Inquisition but it knew the terror value of allowing the threat to hang unspoken in the air.

The great irony, says Hofstadter, is that many of the intellectuals of the Church were well versed in the latest scientific ideas and happy to embrace them. Even the Pope, Urban VIII, before his elevation to high office, had been a friend and ardent admirer of Galileo.

But this was not a trial about which scientific idea was supported by the evidence, as Galileo had naively believed. His arguments - which he thought were so strong they would easily win over the Roman Inquisition - were barely even alluded to, says Hofstadter. The trial was about one thing and one thing only: power. Who wielded it and who yielded to it.

The Roman Church was reeling from the Protestant Reformation, which had reinterpreted the Scriptures. Seeing its power eroded in northern Europe, it felt a desperate need to reassert its authority against any act of defiance. The publication of Galileo's book, despite its approval by the Vatican, was just such an act.

In truth, says Hofstadter, Urban VIII was damned if he did, damned if he didn't. Insisting on a literal interpretation of the Bible was of course bound to come into conflict with observations as scientific instruments improved. On the other hand, the Church had to reassert its slipping power over the minds of men or face oblivion. The Inquisition's uncompromising message was simple: you will believe this because we say so.

Galileo was led away to spend the last years of his life a prisoner in his own home. And a pattern was set for the clash between science and religion, which has echoed down the centuries to this very day.

The Earth Moves is published by WW Norton