The first steps towards a formal method of dike management were taken in the 12th century when the Oude Rijn river silted shut at Katwijk. Even though the Lek river had already superseded the Oude Rijn as the most important means of transport and water management, the area around Leiden suffered dramatically from storm flooding. To combat this problem, the local nobility of Leiden decided to build a dam at Zwadenburg, now called Zwammerdam. This of course only moved the problem eastwards, towards Utrecht, where they complained to the German emperorBarbarossa. In 1165, he decided in favor of Utrecht and the dam was turned into a sluice. Meanwhile, work had already started on digging to increase the efficiency of the small rivers called the "Zyl" and "Does", which would carry the overflow towards the Haarlem Lake and the Kagerplassen. This ambitious project was the result of 15 neighborhoods working together towards a common goal. By 1255, according to the oldest dated document in the Rijnland archives, there was already a group of officials called heemraden who oversaw the dikes along the IJ and at Zwammerdam. Their privileges were described in this document that was given to the dike warden of the area between Wassenaar, the Zwammerdam, and Spaarndam. At that time Rijnland was just one of the many water districts within the area. Each district had a bailiff, and it was the bailiff who was put in charge of dike maintenance. The term Dijkgraaf only began to be used around 1400, when the water district borders differed greatly from the borders of the nearby municipalities. The success of the Zijl and Does river outlets was not enough to avoid heavy floods, and in 1248, a heavy storm again caused a lot of damage, so a dam was built at Spaarndam. This caused a fierce dispute with Haarlem, since that city was dependent on free access for ships to the IJ. The dispute was solved by building an extra sluice in 1253 for ships that could pass when the water levels on both sides of the sluice were the same. To emphasize that control over the sluices and dikes at Spaarndam were under the jurisdiction of the Hoogheemraadschap van Rijnland, Count Willem II granted the privileges to levy a toll on ships to the Dike wardens, and not to the city of Haarlem. It is this document from 1255 that is referred to in the painting by Caesar van Everdingen in 1654. From that point on, the heemraden at Spaarndam were called the heemraden van Rijnland. This would not be the last time that the city of Haarlem got into an argument with the Hoogheemraadschap van Rijnland. In 1514 a heavy storm broke the sluices and the dike at Spaarndam. Haarlem was happy to have the free passage of ships and refused to repair the dike. When the Hof van Holland decided in favor of repairs, Haarlem asked to have the dam moved closer to the city. This would mean that Haarlem would have the dam on its own property, and they would have more control. The heemraden voted against it, and repairs were ordered. In 1517 the dam was not yet ready and Haarlem sent soldiers to destroy the work underway. Again the Hof van Holland needed to mediate the heated tempers and again the decision was in favor of the Heemraden. Haarlem was allowed its own sluice gate for small ships, the Klein Haarlemmersluis, which kept working until 1897, when a new sluice was built. To manage the finances of building and maintaining the dam and all its sluices, it was decided to split the costs among the water boards downstream. Haarlem paid for its own sluice gate, and the Woerdersluis was paid for by the Water board called the Grootwaterschap Woerden, which also released its water overflow via the Spaarndam sluices.
The management of these complicated funding arrangements led to the formation of a new governing body in addition to the hoogheemraden, and these were the hoofdingelanden. These were large landowners with the Water board district who could oversee and approve the finances of the Water board. For several centuries, the daily work of the Hoogheemraadschap van Rijnland was run by one Dike warden and seven hoogheemraden, of which two came from Haarlem and five from Leiden. Their responsibilities were traditionally to oversee the dam at Spaarndam and the dikes along the Zijl and the Does. To meet efficiently, the Hoogheemraadschap bought a meeting hall in 1578, that was also the permanent residence of the Dike warden. The facade was renovated twenty years later in 1598 to keep up with the new town hall. This Gemeenlandshuis is the first one used by the Hoogheemraadschap van Rijnland, but to meet with the Amsterdam Water Board and inspect the dikes along the Haarlemmertrekvaart and the sluices at Halfweg, the Gemeenlandshuis Zwanenburg was built by Pieter Post in 1645-1648. Though nearly demolished today, there is a town named after this building in the Haarlemmermeerpolder called Zwanenburg.