The independence of the Dutch Republic was formally recognized in 1648, as part of the Peace of Westphalia.
During the Thirty Years' War, the Dutch Republic (also known as the United Provinces) was devastated by Spanish forces led by Don Fernando after the Dutch fleet was nearly destroyed by the newly created League of Ostend.
The Dutch Republic effectively ended as a de facto independent state after a peace agreement was reached between Don Fernando and Fredrick Hendrik. This agreement officially united the Netherlands into what became a third Habsburg kingdom, with Don Fernando and Maria Anna of Austria as its rulers. However, one of the terms of the agreement was that the Republic's institutions would effectively remain in place.