Handel composed the work over the period of 19 January to 4 February 1740, and the work was premiered on 27 February 1740 at the Royal Theatre of Lincoln's Inn Fields. At the urging of one of Handel's librettists, Charles Jennens, Milton's two poems, L'Allegro and il Penseroso, were arranged by James Harris, interleaving them to create dramatic tension between the personified characters of Milton's poems (L'Allegro or the "Joyful man" and il Penseroso or the "Contemplative man"). The first two movements consist of this dramatic dialog between Milton's poems. In an attempt to unite the two poems into a singular "moral design", at Handel's request, Jennens added a new poem, "il Moderato", to create a third movement. The popular concluding aria and chorus, "As Steals the Morn" is adapted from Shakespeare's Tempest, V.i.65-68.
Michael O'Connell and John Powell have published an analysis of Handel's setting of the text in his musical treatment.
There are no characters, no specific 'L'Allegro" or "Penseroso". The "drama" comes from alternating episodes representing the humors. Some versions give arias to different soloists. For instance, the "da capo" version of the aria "Straight mine eye hath caught new pleasures" is sung by a soprano (Gardiner, English Baroque Soloists, Monteverdi Choir, 1980) but the truncated recitative version is sung by a bass (Nelson. Ensemble Orchestra de Paris, 2000). Also, all soloists sing in the "il Moderato" section.