Romeo and Juliet borrows from a tradition of tragic love stories dating back to antiquity. One of these is Pyramus and Thisbe, from Ovid's Metamorphoses, which contains parallels to Shakespeare's story: the lovers' parents despise each other, and Pyramus falsely believes his lover Thisbe is dead. The Ephesiaca of Xenophon of Ephesus, written in the 3rd century, also contains several similarities to the play, including the separation of the lovers, and a potion that induces a deathlike sleep.
One of the earliest references to the names Montague and Capulet is from Dante's Divine Comedy, who mentions the Montecchi (Montagues) and the Cappelletti (Capulets) in canto six of Purgatorio:
Come and see, you who are negligent, Montagues and Capulets, Monaldi and Filippeschi One lot already grieving, the other in fear.—Dante, Divine Comedy: Purgatorio, canto VI, ll. 106-8.
However, the reference is part of a polemic against the moral decay of Florence, Lombardy and the Italian Peninsula as a whole; Dante, through his characters, chastises German King Albert I for neglecting his responsibilities towards Italy ("you who are negligent"), and successive popes for their encroachment from purely spiritual affairs, thus leading to a climate of incessant bickering and warfare between rival political parties in Lombardy. History records the name of the family Montague as being lent to such a political party in Verona, but that of the Capulets as from a Cremonese family, both of whom play out their conflict in Lombardy as a whole rather than within the confines of Verona. Allied to rival political factions, the parties are grieving ("One lot already grieving") because their endless warfare has led to the destruction of both parties, rather than a grief from the loss of their ill-fated offspring as the play sets forth, which appears to be a solely poetic creation within this context.
The earliest known version of the Romeo and Juliet tale akin to Shakespeare's play is the story of Mariotto and Gianozza by Masuccio Salernitano, in the 33rd novel of his Il Novellino published in 1476. Salernitano sets the story in Siena and insists its events took place in his own lifetime. His version of the story includes the secret marriage, the colluding friar, the fray where a prominent citizen is killed, Mariotto's exile, Gianozza's forced marriage, the potion plot, and the crucial message that goes astray. In this version, Mariotto is caught and beheaded and Gianozza dies of grief.
Luigi da Porto adapted the story as Giulietta e Romeo and included it in his Historia novellamente ritrovata di due Nobili Amanti published in 1530. Da Porto drew on Pyramus and Thisbe and Boccacio's Decameron. He gave it much of its modern form, including the names of the lovers, the rival families of Montecchi and Capuleti, and the location in Verona. He also introduces characters corresponding to Shakespeare's Mercutio, Tybalt, and Paris. Da Porto presents his tale as historically true and claims it took place in the days of Bartolomeo II della Scala (a century earlier than Salernitano). In da Porto's version Romeo takes poison and Giulietta stabs herself with his dagger.
In 1554, Matteo Bandello published the second volume of his Novelle, which included his version of Giuletta e Romeo. Bandello emphasises Romeo's initial depression and the feud between the families, and introduces the Nurse and Benvolio. Bandello's story was translated into French by Pierre Boaistuau in 1559 in the first volume of his Histories Tragiques. Boaistuau adds much moralising and sentiment, and the characters indulge in rhetorical outbursts.
In his 1562 narrative poem The Tragical History of Romeus and Juliet, Arthur Brooke translated Boaistuau faithfully, but adjusted it to reflect parts of Chaucer's Troilus and Criseyde. There was a trend among writers and playwrights to publish works based on Italian novelles—Italian tales were very popular among theatre-goers—and Shakespeare may well have been familiar with William Painter's 1567 collection of Italian tales titled Palace of Pleasure. This collection included a version in prose of the Romeo and Juliet story named "The goodly History of the true and constant love of Romeo and Juliett". Shakespeare took advantage of this popularity: The Merchant of Venice, Much Ado About Nothing, All's Well That Ends Well, Measure for Measure, and Romeo and Juliet are all from Italian novelle. Romeo and Juliet is a dramatisation of Brooke's translation, and Shakespeare follows the poem closely, but adds extra detail to both major and minor characters (in particular the Nurse and Mercutio).
Christopher Marlowe's Hero and Leander and Dido, Queen of Carthage, both similar stories written in Shakespeare's day, are thought to be less of a direct influence, although they may have helped create an atmosphere in which tragic love stories could thrive.