However, by the late 17th century the Empire's military misfortunes caught up with the country, and the end of the Great Turkish War with the treaty of Karlowitz in 1699 again made Bosnia the Empire's westernmost province. The 18th century was marked by further military failures, numerous revolts within Bosnia, and several outbreaks of plague.