The demoralization of the Swedes and their allies, which was a consequence of the defeat at Nördlingen, was the opportunity of France. Having by clever diplomacy placed garrisons in several places in Alsace and the Palatinate, the king of France, or rather Cardinal Richelieu, now entered the field as a principal, made a definite alliance with Sweden at Compiègne in April 1635, and in the following month declared war and put four armies in motion. But the thoughts of many had already turned in the direction of peace, and in this manner John George of Saxony took the lead, signing in May 1635 the important treaty of Prague with the emperor. The vexed and difficult question of the ownership of the ecclesiastical lands was settled by fixing November 1627 as the deciding date; those who were in possession then were to retain them for forty years, during which time it was hoped a satisfactory arrangement would be reached. The Saxon elector gained some additions of territory and promised to assist Ferdinand to recover any lands which had been taken from him by the Swedes, or by other foes. For this purpose a united army was to serve under an imperial general, and all leagues were to be dissolved. In spite of the diplomatic efforts of Sweden the treaty of Prague was accepted almost at once by the elector of Brandenburg, the duke of Württemberg and other princes, and also by several of the most important of the free cities. It was only, in fact, the failure of Saxony and Sweden to come to terms which prevented a general peace in Germany. The Thirty Years' War now took a different form. Its original objects were almost forgotten and it was continued mainly to further the ambitions of France, thus being a renewal of the great fight between the houses of Habsburg and of Bourbon, and to secure for Sweden some recompense for the efforts which she had put forward.
While the signatories of the peace of Prague were making ready to assist the emperor the only Germans on the other side were found in the army under Bernhard of Saxe-Weimar. The final stage of the war opened with considerable Swedish successes in the north of Germany, especially the signal victory gained by them over the imperialists and the Saxons at Wittstock in October 1636. At the same time good fortune was attending the operations of the French in the Rhineland, where they were aided by Bernhard of Saxe-Weimar, a satisfactory financial arrangement between these parties having been reached in the autumn of 1635. The year 1638 was an especially fortunate one for France and her allies. Bernhard's capture of Rheinfelden and of Breisach gave them possession of the surrounding districts, but dissensions arose concerning the division of the spoil; these, however, were stopped by the death of Bernhard in July 1639, when France took his army into her pay. Thus the war continued, but the desire for peace was growing stronger, and this was reflected in the proceedings of the diet which met at Regensburg in 1640. Under Count Torstenssen the Swedes defeated the imperialists at Breitenfeld in 1642; three years later they gained another victory at Jankau and advanced almost to Vienna, and then the last decisive move of the war was made by the great French general, Turenne. Having been successful in the Rhineland, where he had captured Philippsburg and Worms, Turenne joined his forces to those of Sweden under Wrangel and advanced into Bavaria. Ravaging the land, they compelled the elector Maximilian to sign a truce and to withdraw his troops from the imperial army. When, however, the allied army had retired Maximilian repented of his action. Again he joined the emperor, but his punishment was swift and sure, as Turenne and Wrangel again marched into the electorate and defeated the Bavarians at Zusmarshausen, near Augsburg, in May 1648. A few minor operations followed, and then came the welcome news of the conclusion of the treaty of Westphalia.