Middelburg received city rights in 1217, which meant that the medieval settlement that the city was then had the right to secure the urban area by means of enclosures. First they laid an earthen wall, a moat and a palisade, but later on they also built stone walls, towers and city gates - that was even safer. The city gates often had the character of real defenses. They had large, heavy gate doors, usually containing a smaller entrance door, locking bars, drop fences (hameids), loopholes, turrets and drawbridges. In the Middle Ages, Middelburg had eight city gates: the Noorddampoort (later the Veersepoort), the Zuiddampoort, the Koepoort, the Noordpoort, the Seispoort, the Langevielepoort, the Vlissingsepoort (previously called the Gortstratepoort) and Segeerspoort or St. Geertruidspoort. These gates are clearly visible on the map that Jacob van Deventer made around 1550 of the city. The strategically located gates, in addition to a defensive, also had a controlling function - one could easily keep track of who entered and left the city. The gates also had opening and closing times indicated by the ringing of the existing gate bells or else the city clock; in Middelburg it was the clock of the town hall.
The city gates also generated income directly and indirectly. Directly by collecting the toll that had to be paid - the city sometimes leased the toll. Indirectly by various organizations that attracted the gates; so there was one or more inns in the vicinity of every gate. The city gates have changed location over the centuries and sometimes also their names, but more about this at the following, separate gates.
The oldest Koepoort was probably in the vicinity of the Spanjaardstraat at the Spuistraat. In the city account of 1396-1397 this door nearby the coepoort in the Begijnhof (called the door at the Koepoort in the Begijnhof - large, beguinage was roughly in the triangle Zuidsingel-Wagenaarstraat-Spanjaardstraat). This medieval gate was demolished in 1593 and a wooden gate was built at the end of the current Koepoortstraat. This gate was already called the old Koepoort in 1605, because during the big city extension of 1595-1598 a new, so actually third, Koepoort was built on the north side of the Molenwater. This third Koepoort was demolished in 1735 and in 1739 was, at the same location, the fourth and final Koepoort, built by builder Jan de Munck, a fact .. The Koepoort is the only city gate that still exists (in 1992-1993 she was carefully restored) and until 2016 it served as a house annex studio of a visual artist Leendert van der Pool.