Having used a military march by Ulysses Balsimelli with lyrics by Aurelio Muccioli as an unofficial anthem at patriotic events for many years, the request to create an official national anthem fell to Italian violinist and composer Federico Consolo. Adopted on September 11, 1894 and first performed in public on September 30 that year at the inauguration of the Public Palace, the work was based on a 10th century chorale and was slightly reworked in 1899[1] to the version used today.
There are no official lyrics, but there are unofficial lyrics written by Giosuè Carducci.
Sources:
[1] “Inno Nazionale della Repubblica di san Marino,” Banda Militare della Repubblica di San Marino, accessed February 23, 2023, https://www.bandamilitaresanmarino.org/inno-nazionale/ .
Special thanks to: Pavel Zinovatny for the lyrics and Federico Serra for the English translation of Muccioli’s work