The poem may have been inspired by James Cook's second voyage of exploration (1772–1775) of the South Seas and the Pacific Ocean; Coleridge's tutor, William Wales, was the astronomer on Cook's flagship and had a strong relationship with Cook. On this second voyage Cook crossed three times into the Antarctic Circle to determine whether the fabled great southern continent existed. Critics have also suggested that the poem may have been inspired by the voyage of Thomas James into the Arctic. "Some critics think that Coleridge drew upon James's account of hardship and lamentation in writing The Rime of the Ancient Mariner."
According to William Wordsworth, the poem was inspired while Coleridge, Wordsworth, and Wordsworth's sister Dorothy were on a walking tour through the Quantock Hills in Somerset in the spring of 1798. The discussion had turned to a book that Wordsworth was reading, A Voyage Round The World by Way of the Great South Sea (1726) by Captain George Shelvocke. In the book, a melancholy sailor, Simon Hatley, shoots a black albatross:
- We all observed, that we had not the sight of one fish of any kind, since we were come to the Southward of the streights of le Mair, nor one sea-bird, except a disconsolate black Albatross, who accompanied us for several days ... till Hattley, (my second Captain) observing, in one of his melancholy fits, that this bird was always hovering near us, imagin'd, from his colour, that it might be some ill omen ... He, after some fruitless attempts, at length, shot the Albatross, not doubting we should have a fair wind after it.
As they discussed Shelvocke's book, Wordsworth proffers the following developmental critique to Coleridge, which importantly contains a reference to tutelary spirits: "Suppose you represent him as having killed one of these birds on entering the south sea, and the tutelary spirits of these regions take upon them to avenge the crime." By the time the trio finished their walk, the poem had taken shape.
Bernard Martin argues in The Ancient Mariner and the Authentic Narrative that Coleridge was also influenced by the life of Anglican clergyman John Newton, who had a near-death experience aboard a slave ship.
The poem may also have been inspired by the legends of the Wandering Jew, who was forced to wander the earth until Judgement Day for taunting Jesus on the day of the Crucifixion, and of the Flying Dutchman.
The poem received mixed reviews from critics, and Coleridge was once told by the publisher that most of the book's sales were to sailors who thought it was a naval songbook. Coleridge made several modifications to the poem over the years. In the second edition of Lyrical Ballads, published in 1800 (see 1800 in poetry), he replaced many of the archaic words.