In 1349, the region of Halychyna (Galicia) became part of the Kingdom of Poland. As a part of Ruthenian Voivodeship remained in Poland from 1434 until 1772 (see Partitions of Poland). It was during this time that the area experienced a large influx of Polish, Jewish and Armenian settlers. In the late 14th century, Polish nobleman (szlachta), Michał Awdaniec, Abdank coat of arms became the owner of the town on 1360-s or 1370-s. On July 28, 1379, Michał Awdaniec founded a Roman Catholic parish church, and built a castle. agreed to grant Magdeburg rights to Buchach (Buczacz): it was first Magdeburg-style city, located in the Halych Land. In the early 15th century, the Awdaniec family of Buchach changed its last name into Buczacki, after its main residence. Frequent invasions of the Crimean Tatars brought destruction to the town, and in 1515, it once again received the Magdeburg rights. In 1558 Katarzyna Tworowska nee Buczacka get the king's grant for market in Buchach. In 1580, local castle was rebuilt: the castle was twice besieged by the Tatars (1665, 1667), who finally captured it in 1672, during the Polish–Ottoman War (1672–1676). Buchach was a temporary residence of Mehmed IV; here, on October 18, 1672, the Treaty of Buchach was signed between Polish–Lithuanian Commonwealth and the Ottoman Empire. According to this treaty, Poland handed the provinces of Ukraine and Podolia to Turkey.