There are indications that around the end of the twelfth century there was a small settlement with town-like characteristics situated next to the castle. It received its official status in 1230 when the German King Henry VII decided to grant the inhabitants city privileges. Due to this, Nijmegen received the same rights and liberties as Aachen and other cities in the German realm. In retrospect the Nijmegen royal city privileges are unique to the Netherlands. Other cities received their privileges from a duke, a count, or the bishop of Utrecht. Due to its city privileges Nijmegen had a certain level of autonomy when it came to government, justice and taxation. From the twelfth century the king appointed a viscount for the daily control of the castle and the city. To execute government and justice the viscount was assisted by aldermen. The aldermen were distinguished, most often middle class, people appointed by the king. The middle class established the city council. This council appointed the two mayors who occupied themselves with finances and public works.
After Frederick Barbarossa’s time (1152-1190) the influence of the German kings in the Low Countries decreased as they became more focussed on their central German districts. Officially they still held the highest authority in the Low Countries, but the noblemen exercised the power. Formally this was in name of the king, but actually they were independent. Examples of these noblemen are the duke of Brabant, the count of Holland, the count of Gelders, and also the bishop of Utrecht.The German kings were elected and spent vast amounts of money on their elections. This is why count William II of Holland was in acute financial trouble when he was elected king in 1247. To keep his head above water he borrowed 10,000 silver marks from count Otto II of Gelders. As collateral for the loan William II gave the count of Gelders the castle and the city of Nijmegen, to which the Rijk van Nijmegen also belonged. In theory the German kings could have been given the castle and the city back if they paid off the loan. This never happened, leaving Nijmegen and the Rijk van Nijmegen in the ownership of the county Gelders. This was an important territorial gain for the count of Gelders. However, the city Nijmegen did not consider itself as a Gelders city, but a ‘free imperial city’: a city that was under the direct authority of the German king and not the count of Gelders.