'''''Il re pastore''''' (''The Shepherd King'') is an opera, K. 208, written by Wolfgang Amadeus Mozart to an Italian libretto by Metastasio, edited by Gianbattista Varesco. It is an opera seria. The opera was first performed on April 23, 1775 in Salzburg, at the Palace of the Archbishop Count Hieronymus von Colloredo.
In 1775 the opera was commissioned for a visit by the Archduke Maximilian Francis of Austria, the youngest son of Empress Maria Theresa, to Salzburg. Mozart spent six weeks working on the opera. It consists of two acts and runs for approximately 107 minutes.
Metastasio wrote the libretto in 1751, basing it on a work by Torquato Tasso called ''Aminta''. The libretto was picked up when Mozart (just 19 at the time) and his father saw a performance of it set to music composed by Felice Giardini – Mozart's version, however was two acts rather than Giardini's three, and has a few substantial changes. Each act lasts for around an hour in performance. The Salzburg court chaplain Varesco was largely responsible for this editing of Metastasio's libretto.
It is often referred to not as an opera, but as a serenata, a type of dramatic cantata. The appearance of a quartet of lovers (Aminta and Elisa, Agenore and Tamiri) of somewhat dubious fidelity automatically puts a modern audience in mind of ''Così fan tutte''. The principal psychological theme of the opera is, however, the demands of love against the demands of Kingship, as Aminta, the Shepherd-king, tussles with his conscience, and in this ''Il re pastore'' is closer in theme to ''Idomeneo'' than any other of Mozart's operas. Indeed, ''Idomeneo'' was the next completed opera that Mozart wrote after ''Il re pastore'', after his six-year-long break from the stage. Furthermore, the theme of qualities for Kingship appears in another opera, ''La clemenza di Tito'', his last one.