Being one of the most renowned scientist of his time Galileo's opinions were scrutinized not only be his peers, but by also by Church officials and the public in general. This made Galileo the lightning-rod of many complaints against the Copernican doctrine (and also some against Galileo himself). He did not come out unscathed out of these encounters.
In 1611 Galileo came to the attention of the Inquisition for the first time for his Copernican views. Four years later a Dominican friar, Niccolo Lorini, who had earlier criticized Galileo's view in private conversations, files a written complaint with the Inquisition against Galileo's Copernican views. Galileo subsequently writes a long letter defending his views to Monsignor Piero Dini, a well connected official in the Vatican, he then writes his Letter to the Grand Duchess Christina arguing for freedom of inquiry and travels to Rome to defend his ideas
In 1616 a committee of consultants declares to the Inquisition that the propositions that the Sun is the center of the universe and that the Earth has an annual motion are absurd in philosophy, at least erroneous in theology, and formally a heresy. On orders of the Pope Paul V, Cardinal Bellarmine calls Galileo to his residence and administers a warning not to hold or defend the Copernican theory; Galileo is also forbidden to discuss the theory orally or in writing. Yet he is reassured by Pope Paul V and by Cardinal Bellarmine that he has not been on trial nor being condemned by the Inquisition.
In 1624 Galileo meets repeatedly with his (at that time) friend and patron Pope Urban VIII, he is allowed to write about the Copernican theory as long as he treated it as a mathematical hypothesis.
In 1625 a complaint against Galileo's publication The Assayer is lodged at the Inquisition by a person unknown. The complaint charges that the atomistic theory embraced in this book cannot be reconciled with the official church doctrine regarding the Eucharist, in which bread and wine are ``transubstantiated'' into Christ's flesh and blood. After an investigation by the Inquisition, Galileo is cleared.
In 1630 he completed his book Dialogue Concerning the Two Chief World Systems in which the Ptolemaic and Copernican models are discussed and compared and was cleared (conditionally) to publish it by the Vatican. The book was printed in 1632 but Pope Urban VIII, convinced by the arguments of various Church officials, stopped its distribution; the case is referred to the Inquisition and Galileo was summoned to Rome despite his infirmities.
In 1633 Galileo was formally interrogated for 18 days and on April 30 Galileo confesses that he may have made the Copernican case in the Dialogue too strong and offers to refute it in his next book. Unmoved, the Pope decides that Galileo should be imprisoned indefinitely. Soon after, with a formal threat of torture, Galileo is examined by the Inquisition and sentenced to prison and religious penances, the sentence is signed by 6 of the 10 inquisitors. In a formal ceremony at a the church of Santa Maria Sofia Minerva, Galileo abjures his errors. He is then put in house arrest in Sienna. After these tribulations he begins writing his Discourse on Two New Sciences.
Galileo remained under house arrest, despite many medical problems and a deteriorating state of health, until his death in 1642. The Church finally accepted that Galileo might be right in 1983.