In 1340 it was annexed to Poland by King Casimir III following the Galicia–Volhynia Wars, along with the rest of the Kingdom of Rus'. Sometime in the 1340s, another fortress was erected there. In a short time the settlement became one of the most notable centres of commerce in the area. Because of that, the population rose rapidly.