all levels establishment. The Commonwealth military lacked talented commanders and lost its will to fight for a cause, even though during the Northern War it could be up to 50,000 men strong (in addition to the Saxon army of 30,000). After 1717, the radically reduced Polish army had become a neglected rump of its former self. The Commonwealth diplomacy likewise fell into obscurity, in spite of the extensive resident European diplomatic service maintained by Augustus II and staffed mostly by Saxons. The Commonwealth had become a passive participant of European politics, which contrasted with the activist, but unconcerned in this respect Saxon court. At the outset of his reign Augustus II arrived at an understanding with Frederick III, Elector of Brandenburg, which allowed the Hohenzollern ruler to take over Elbing (Elbląg) in 1698. The strong negative reaction in the Commonwealth provided one more opportunity for attacking the former Prussian vassal, which might have been Augustus' objective. But the matter was resolved through negotiations and Frederick's withdrawal from the city in 1700, only to be followed by partial reoccupation of the area in 1703. A treaty involving Saxony, Russia and Denmark, through which the signatories sought to recover territories previously appropriated by Sweden, was concluded in 1699 and became a prelude to the Great Northern War. The Danes were worried by the Swedish penetration of Holstein, peace with the Ottoman Empire allowed Peter I of Russia to direct his attention to the north, and Augustus II represented the Polish claim to Livonia, where his protection had been requested by Johann Patkul, a representative of the Livonian nobility. The hostilities were initiated early in 1700, when the Danes attacked Holstein and Augustus tried to take over Riga by a sudden action. But the Swedish army was prepared and under the exceptional command of Charles XII, a guarantor of Holstein independency along with England and the Netherlands, who soon forced Denmark to accept peace and routed Peter I's larger force at the Battle of Narva. Augustus II, unable to take Riga even after a long siege, wanted to pull out of the war. For Sweden however the union of Saxony and the Commonwealth seemed a strategic and economic threat and Charles demanded that Augustus relinquishes the Polish throne as the condition for peace. The Swedish monarch expected considerable support within the Commonwealth, where in Lithuania the powerful and abusive Sapieha magnate faction was