Napoleon's baptism took place in Ajaccio on 21 July 1771; he was piously raised and received a Christian education; however, his teachers failed to give faith to the young boy.[163] As an adult, Napoleon was described as a "deist with involuntary respect and fondness for Catholicism."[164] He never believed in a living God; Napoleon's deity was an absent and distant God,[163] but he pragmatically considered organised religions as key elements of social order,[163] and especially Catholicism, whose, according to him, "splendorous ceremonies and sublime moral better act over the imagination of the people than other religions".[163]
Napoleon had a civil marriage with Joséphine de Beauharnais, without religious ceremony, on 9 March 1796. During the campaign in Egypt, Napoleon showed much tolerance towards religion for a revolutionary general, holding discussions with Muslim scholars and ordering religious celebrations, but General Dupuy, who accompanied Napoleon, revealed, shortly after Pope Pius VI's death, the political reasons for such behaviour: "We are fooling Egyptians with our pretended interest for their religion; neither Bonaparte nor we believe in this religion more than we did in Pius the Defunct's one".[note 9] In his memoirs, Bonaparte's secretary Bourienne wrote about Napoleon's religious interests in the same vein.[166] His religious opportunism is epitomized in his famous quote: "It is by making myself Catholic that I brought peace to Brittany and Vendée. It is by making myself Italian that I won minds in Italy. It is by making myself a Moslem that I established myself in Egypt. If I governed a nation of Jews, I should reestablish the Temple of Solomon."[167] However, according to Juan Cole, "Bonaparte's admiration for the Prophet Muhammad, in contrast, was genuine"[168] and during his captivity on St Helena he defended him against Voltaire's critical play Mahomet.
Napoleon was crowned Emperor Napoleon I on 2 December 1804 at Notre Dame de Paris by Pope Pius VII. On 1 April 1810, Napoleon religiously married the Austrian princess Marie Louise. During his brother's rule in Spain, he abolished the Spanish Inquisition in 1813. In a private discussion with general Gourgaud during his exile on Saint Helena, Napoleon expressed materialistic views on the origin of man,[note 10]and doubted the divinity of Jesus, stating that it is absurd to believe that Socrates, Plato, Muslims, and the Anglicans should be damned for not being Roman Catholics.[note 11] He also said to Gourgaud in 1817 "I like the Mohammedan religion best. It has fewer incredible things in it than ours."[171] and that "the Mohammedan religion is the finest of all".[172] However, Napoleon was anointed by a priest before his death.[173]