At the end of 1654, after several months of intense depression, Pascal had a religious experience that altered his life. He entered the Jansenist monastery at Port-Royal, although he did not take orders. He never published in his own name again. The Jansenists encouraged him in his mathematical studies, which he resumed. To assist them in their struggles against the Jesuits, he wrote, under a pseudonym, a defense of the famous Jansenist Antoine Arnauld, in the form of 18 epistles. Known as Lettres provinciales, they were likely responsible for the subsequent reputation of the Jesuits as hypocritical and casuistic. In 1658 he broke with the Jansenists and left the monastery. He continued mathematical study and worked on calculus and on probability theory with Pierre de Fermat.
Pascal died at the age of 39 in intense pain after a malignant growth in his stomach spread to the brain. His most famous work is the Pensees (Thoughts), a set of deeply personal meditations in somewhat fragmented form on human suffering and faith in God. "Pascal's wager" expresses the conviction that belief in God is rational: if God does not exist, one stands to lose nothing by believing in him anyway, while if he does exist, one stands to lose everything by not believing.