The Hanseatic League took control over Norwegian trade during the 14th century and established a trading center in Bergen. In 1380, Olaf Haakonsson inherited both the Norwegian and Danish thrones, creating a union between the two countries. In 1397, under Margaret I, the Kalmar Union was created between the three Scandinavian countries. She waged war against the Germans, resulting in a trade blockade and higher taxation on Norwegian goods, which resulted in a rebellion. However, the Norwegian Council of State was too weak to pull out of the union.