Between 1657 and 1660, he fought in the Second Northern War where he invaded Swedish Pomerania in 1659. In the Austro-Turkish War (1663–1664), he commanded the Habsburg Northern Army operating in Upper Hungary. In 1664 he conquered Nitra and Levice. On July 19, 1664 he won the important Battle of Levice against the Ottomans.