The situation, however, soon radically deteriorated. From 1648 the Cossack Khmelnytsky Uprising engulfed the south and east, and was soon followed by a Swedish invasion, which raged through core Polish lands. Warfare with the Cossacks and Russia left Ukraine divided, with the eastern part, lost by the Commonwealth, becoming the Tsardom's dependency. John III Sobieski, fighting protracted wars with the Ottoman Empire, revived the Commonwealth's military might once more, in the process helping decisively in 1683 to deliver Vienna from a Turkish onslaught.