The Peace of Prague in 1636 ended the civil war aspect of the Thirty Years' War between the Hapsburg Emperor Ferdinand II and the Electorate of Saxony, with Saxony gaining territories. The Franco-Swedish Intervention from 1635 to 1648 involved France and Sweden aiding Protestant forces against the Holy Roman Empire. The Peace of Westphalia in 1646 finally ended the Thirty Years' War, establishing religious toleration within the Holy Roman Empire and redrawing territorial boundaries.