Prussia was ill-suited for lengthy wars, and a Prussian collapse seemed imminent on account of casualties and lack of resources, but after two more years of campaigning, Frederick was saved by the "Miracle of the House of Brandenburg" — the Russian exit from the war after the sudden death of Empress Elizabeth in 1762. Prussian control of Silesia was confirmed in the Treaty of Hubertusburg (1763). Severe casualties had led the king to admit middle class officers during the war, but this trend was reversed afterwards.