Situated along the Byfjord, Bergen is the second largest city in Norway, and one of its most charming destinations. The history of this city dates back to the early eleventh century when Olav Kyrre established a settlement and royal residence here. In 1240, Bergen replaced Trondheim as the capital of Norway, and the city quickly prospered under the guidance of the Hanseatic League. These German merchants soon controlled all trade in Norway and remained in the city for many centuries until 1764. Much of the city"s architecture today reflects the lifestyle of the Hanseatic merchants, who resided in narrow row houses near the harbor.