Haydn was inspired to write a large oratorio during his visits to England in 1791–1792 and 1794–1795, when he heard oratorios of Handel performed by large forces. Israel in Egypt is believed to have been one of these. It is likely that Haydn wanted to try to achieve results of comparable weight, using the musical language of the mature classical style.
The work on the oratorio lasted from October 1796 to April 1798. It was also a profound act of faith for this deeply religious man, who appended the words "Praise to God" at the end of every completed composition. He later remarked, "I was never so devout as when I was at work on The Creation; I fell on my knees each day and begged God to give me the strength to finish the work." Haydn composed much of the work while at his residence in the Mariahilf suburb of Vienna, which is now the Haydnhaus. It was the longest time he had ever spent on a single composition. Explaining this, he wrote, "I spent much time over it because I expect it to last for a long time." In fact, he worked on the project to the point of exhaustion, and collapsed into a period of illness after conducting its premiere performance.
Haydn's original autograph score has been lost since 1803. A Viennese published score dated 1800 forms the basis of most performances today. The 'most authentic' Tonkünstler-Societat score of 1799, with notes in the composer's hand, can be found at the Vienna State Library. There are various other copyist scores such as the Estate, as well as hybrid editions prepared by scholars during the last two centuries.