In course of Polish–Ottoman War (1672–1676) Terebovlia castle became an important border fortress after the partition of Podolia by Turkey in 1671. Armistice in war followed by Treaty of Buchach which ultimately was rejected by Sejm of the Polish–Lithuanian Commonwealth and war resumed. In 1675 Mehmed IV sent a new 10,000-strong Turkish-Tatar army under command of Pasha Ibrahim Shyshman to enter Ukraine and on September 20 the siege of Terebovlya began. Despite considerable numerical advantage, Pasha Ibrahim Shyshman was unable to capture the castle and on October 11 retreated south in anticipation of the early start of winter season. This saved the rest of Podillya, Galicia from the attack.