The oldest mention of Piran as a Byzantine settlement date back to the 7th century. Between 1283 and 1797 the town was in possession of the Republic of Venice. Especially during the Middle Ages, Piran was an important trading place for oil, wheat, wood, wine and salt. From 1797 the town belonged to the Austrian Empire almost without interruption up until 1918. After World War I Piran (Italian Pirano) became part of Italy according to the Treaty of Rapallo. After World War II it became part of Yugoslavia. With the dissolution of Yugoslavia in 1991 it is now part of Slovenia.
The most famous native of Piran is certainly the composer and violin virtuoso
Giuseppe Tartini (1692–1770).