During the 'foreign rule' by Burgundy and Habsburg, the county was governed by a stadtholder in name of the count. In 1581, the Estates General of the United Provinces declared themselves independent from the Spanish rule of Philip II (who was Philip III of Holland). Until the Treaty of Münster in 1648, the kings of Spain still used the title Count of Holland, but they had lost the actual power over the county to the States of Holland.