The following year, hetman Jan Tarnowski recaptured the town and defeated the Moldavians in the Battle of Obertyn. This victory secured the city's existence for the following years, but the Ottoman power grew and Poland's southern border remained insecure.