During the early middle ages, the Frankish Empire ruled over the low countries, expanding outwards from France. During much of the late middle ages, the Spanish ruled over what is today the Netherlands. But, in 1581, the Dutch finally gained independence. After this occured, the provinces agreed to form a Confederation, thus uniting the country. The Netherlands went through a golden age in the 1600s, and had much power in the seas and by trade. The Dutch East India and West India companies would soon establish trading outposts all over the world. In the late 18th century, Dutch republicans, with support of French republicans, founded the Batavian Republic. This was short lived, however, as it would soon turn back into a Kingdom in the early