Michał Kazimierz Pac joined the army as a young man and steadily rose through its ranks. In 1663, during the Second Northern War (Deluge), when the territory of the Polish–Lithuanian Commonwealth was occupied by Russian and Swedish soldiers, Pac was appointed as the Field Hetman of Lithuania and voivode of Smolensk. He was further promoted to Great Hetman in 1667 and voivode of Vilna in 1669. Pac opposed election of Michael Korybut Wiśniowiecki (ruled 1669–1673) to the throne of the Commonwealth. In 1673, Pac fought in the Battle of Chocim against the Turks. After the death of Wiśniowiecki, he opposed election of John III Sobieski (ruled 1674–1696). When it was discovered that Pac plotted with Austria and Brandenburg against Sobieski, he fell from public favor.