Anhalt-Harzgerode was a small principality of the Holy Roman Empire, ruled by the House of Ascania with its residence at Harzgerode in present-day Saxony-Anhalt.
Frederick served in the Swedish infantry until the Lutheran Elector John George of Saxony concluded the Peace of Prague with the Habsburg emperor Ferdinand II in 1635.
Back in Anhalt, he and his brother came to terms in December and divided their father's heritage: while Christian II succeeded as Prince of Anhalt-Bernburg, Frederick received the westernmost districts (Ämter) of Harzgerode, which had just been devastated by a blaze, and Güntersberge in the Harz mountain range.
Finally in 1641, urged by his brother, he returned to Harzgerode and married Johanna Elisabeth (1619–1647), daughter of Prince John Louis of Nassau-Hadamar the next year.
Frederick made significant efforts to alleviate the impacts of the war on his tiny principality and for the reconstruction after the final Peace of Westphalia.