The Carmen in victoriam Pisanorum ("Song on the occasion of the victory of the Pisans") is a poem celebrating the victory of the Italian maritime republics in the Mahdia campaign of 1087/8. It was probably written by a Pisan cleric within months of the campaign.G. H. Pertz was the first to note the historical value of the text in 1839. It is an important source for the development of Christian ideas about holy war on the eve of the First Crusade (1095–99), and may have been influenced by the contemporary theology of Anselm of Lucca and his circle. It seems to have influenced the Gesta Francorum, an account of the First Crusade composed by someone in the south Italian contingent. All of the later Pisan sources for the Mahdia campaign rely mainly on it: the Chronicon Pisanum only adds details about the memorial church, the Annales Pisani of Bernardo Maragone only rewords the former, and the Cronaca di Pisa of Ranieri Sardo and the Breviarium Pisanae historiae add only legendary material to the account.
The text of the Carmen survives in a single copy in MS. 3879–919, ff. 63r–65v, in the Bibliothèque royale Albert Ier in Brussels. The manuscript originated in Italy in the twelfth century and contains 174 folios. The mansucript begins with the words "Here begins the prologue of the book of Guido, composed of various histories for diverse uses for edification of the reader", but there is no reason to believe that Guido of Pisa is the author of the Carmen. In fact, the Brussels manuscript is a careless copy of the original Liber Guidonis, which places the surviving Carmen at least two stages removed from the original. It has come down to us without a title, the conventional title has been supplied by editors.