Frederick also asked the French philosopher Voltaire to live with him at Sanssouci. Their literary correspondence and friendship, which spanned almost 50 years, began as a flirtation and maintained a mutual intellectual fascination. However, Frederick found Voltaire difficult to live with in person. In addition, Frederick was often annoyed by Voltaire's many quarrels with his other friends. Voltaire's angry attack on Maupertuis, the President of Frederick's academy, in the form of a pamphlet, ("The Diatribe of Doctor Akakia") provoked Frederick to burn the pamphlet publicly and put Voltaire under house arrest, after which Voltaire left Prussia. When Voltaire left, he took with him poems by Frederick mocking other rulers that could compromise Frederick. Frederick had his agents detain Voltaire in Frankfurt am Main on his way back to France and forced him to surrender the poems. This episode, which has been called a "lover's quarrel", cooled Frederick and Voltaire's friendship. Eventually, they resumed their correspondence, aired their mutual recriminations, and remained on friendly terms until Voltaire's death.