The grand vizier, however, was overthrown by a palace intrigue, and was replaced by an incorruptible successor, Numa Chourgourly, who was equally determined to treat the fugitive king in becoming fashion and to decline to make war on the Tsar. Meanwhile, Charles's enemies were taking advantage of his enforced absence. Peter again overran Livonia.
Augustus repudiated the treaty of Altranstad, and recovered the Polish crown. The King of Denmark repudiated the treaty of Travendal, and invaded Sweden, but his troops were totally routed by the raw levies of the Swedish militia at Helsimburg. The Vizier Chourgourly, being too honourable for his post, was displaced by Baltaji Mehemet, who took up the schemes of Charles.