The construction of the medieval city walls began under the Venetian rulers in 1278. However, it remains unclear whether a similar protective barrier already existed earlier. The construction work progressed only very slowly. This is documented by a Venetian decision of 1326-1327 indicating that the inhabitants of Hvar were paid for the completion of the still unfinished walls. Today's city walls were not built until the mid-15th century, after Hvar had fallen to the Republic of Venice. During the 16th century they increasingly decayed and soon lost their original purpose, when the city began to spread beyond the city walls. The city walls have four gates: The southwestern gate is the main gate – "Porta Maestra". The southeastern gate across from the Bishop's Palace is known as the gate of the Virgin Mary, the western gate as "Gojave" and the eastern gate as "Badeor" or simply "Gradno vrota" (City Gate).