Virtually nothing is known of Alessandro Scarlatti's early musical education, though he likely became a choirboy at a local church and may have studied the rudiments with the choirmaster. At the age of 12 he was sent off to a relative in Rome. He may have studied with Carissimi there until 1674, when the older composer died.
In April 1678, Scarlatti married Antonia Anzalone, who would bear him ten children, though only half would survive to adulthood. Around this time the composer became the maestro di cappella for Queen Christina of Sweden, an arts patron who had founded two academies at her palace in Rome. He served in this post until 1684, when he departed for Naples. By this time he had scored a great success in Rome with his first opera, Gli equivoci nel sembiante (1679), and with subsequent ones, along with many cantatas and oratorios.
At Naples, he was appointed maestro di cappella at the Viceregal Chapel, under the Viceroy of Naples, Marquis del Carpio. By the 1690s, Scarlatti was writing operas and serenatas at a prolific pace, owing mainly to the requirements of his position. One of his most successful large works during this decade was his opera Il Pirro e Demetrio, which was performed throughout Italy and elsewhere in Europe to critical and public acclaim.
Scarlatti took a leave of absence in June 1702, and traveled to Florence with his son, Domenico, who now exhibited his own musical talents. The elder Scarlatti had hoped for a post with Prince Ferdinando de Medici, but could not obtain one, though he would write much music for him in the coming years, including four operas. In 1703, he took on music directorship at St. Maria Maggiore in Rome, but was unhappy in the post from the first, since the Pope had forbidden theatrical performances there, thus frustrating the creative urges of any composer of opera and especially of one so prolific.
In 1707, Scarlatti was promoted to maestro di cappella at St. Maria Maggiore, but a year later, following financial difficulties, he returned to Naples to serve in his former post. He would spend another 10 years there, remaining highly productive throughout, turning out many operas, including Giunio Bruto (1710) and the highly successful Il Tigrane (1715). From 1718 to 1722 Scarlatti was on leave, mostly in Rome, where his operas could now be staged. After his return to Naples in 1722, his output declined, while his financial hardships increased. He died in 1725, leaving his family in debt and ignored by those who had owed him salary.