The history of the settlement is directly connected to that of the neighboring town of Piran, with Illyrian settlers already living there in the prehistoric era. They were followed by Celtic tribes, which were later conquered and annexed by the Roman Empire in 178 B.C. Archaeological finds suggest that in this period many farms and villas, also named villae rusticae, were built in the area. A large development of the area followed only after the demise of the empire, with enlargement of the number of settlers seeking shelter from attacks by the Barbarians.
In the 7th century the area was a part of the Byzantine empire. Due to increasing dissatisfaction with the feudal rule, as well as rising power of the Venetian Republic, the settlement of Pirano signed a trade treaty with Venice, which included a lesser degree of autonomy.
One of the first religious orders who came to this area were the Benedictines. In the 12th century, the broader region already had four monasteries, and even more churches. Among those, one of the oldest was the church of Saint Mary Rosary, which stood by the bay in the beginnings of the 13th century. Its name was Sancta Maria Roxe or S. Maria delle Rose, and in 1251 the bay was named by it Portus sanctae Mariae de Rosa.
One of the most important roles in the history of the settlement was the monastery of Saint Laurence, where the Benedictines healed rheumatic illnesses, ascites and other diseases with concentrated salt water and saline mud. In the 1210 the area was overtaken by the Patriarchy of Aquileia.
In the 13th century Pirano entered a brief war from December 1282 to January 1283 in which it was defeated by the Venetian Republic.
During the second Venetian rule, it was, contrary to other towns on the Istrian peninsula, loyal to Venetian rule, and as such gained special privileges within the republic, which in turn caused the local economy to boom. In 1797 Venetian rule came to a close as the Austrian Empire took over the area for a brief period until 1806. From 1806 to 1813 the entire Istrian Peninsula became part of the Illyrian Provinces.