According to the royal sagas written by the Icelandic historian Snorri Sturluson, based on a number of earlier written sources, it was Håkon den gode (Håkon the Good - king of Norway about 945-960) who gave the Gulating laws in consultation with Torleiv Spake. However, if the Icelandic sources of "Islendingabok" and "Egilssoga" are correct, the Gulating must be even older, probably dating from before 930. The original core area of the Gulatingslagen - the Gulating jurisdiction - comprised the old counties of Hordafylke, Sygnafylke and Firdafylke, corresponding more or less to the present two counties of Hordaland and Sogn og Fjordane. It is a likely assumption that the first Norwegian kings, from the time of Harald Hårfagre (Fairhair) sought to form a power base in this area. In this connection, legislation was an important element. It was probably under the reign of Håkon the Good that the jurisdiction was extended also to comprise the two counties of Egdafylkje and Rygjafylkje to the south (the present Outer Agder and Rogaland respectively), in addition to Sunnmøre to the north.
From "allting" (everyman's) assembly to a "lagting" (territorial court)
The Gulating laws were a territorial right within the jurisdiction. Knut Helle, an expert on the Gulating, is of the opinion that it probably was an "allting" at first, where all free men who wanted to could convene. Most farmers most likely came in the company of the local chieftains who had submitted themselves to the Crown. When the jurisdiction was extended, the need arose for a more representative assembly. According to the so-called "Olavstekst", which constitutes the oldest preserved written parts of the law, 375 so-called "nevndemenn" - appointed county representatives - had to take part in the territorial "lagting" court. In the later "Magnustekst", this number was reduced to 246. Only persons of authority with a royal mandate - "lendmenn", "årmenn" and "syslemenn" - were allowed to select those who could take part at these judicial assemblies.
From oral to written law
According to Are Frode's book "Islendingabok" the Althing and the Icelandic legal system were to a large extent based on the way the Gulating was organized. Thus the conclusion must be that western Norwegian legal system must have been based on the laws remembered and interpreted by wise and learned men, as well as what the convened assembly decided was valid. At what time the law was made in writing is hard to say. The "Magnustekst" referred to above is a legal revision from the reign of King Magnus Erlingsson (the 1160s), whereas the "Olavstekst" is even older. It is uncertain how much is taken from this latter text, but the name points to Olaf II Haraldsson (later canonized to Saint Olaf).
National law and change of court site
Magnus Erlingson's revision of the law in the 1160s was the first attempt at working out a nationwide legislation. However, this was thwarted by the civil wars, and only 100 years later, did King Magnus Haakonsson introduce the National Law. This law decreed that the king was the highest-ranking justice in the realm, superior to the "lagting". It was in those days that the Norwegian power and the royal power reached its apex in the High Middle Ages.
During the reign of Magnus' successor Haakon 5. Magnusson (king 1299-1319), the reorganization of the Norwegian legal system continued. About 1310, the annual court assembly of Gulatinget was moved from Gulen to Bergen. At present this is called the Gulating Court of Appeal.