In the 13th century, the Gouwe was connected to the Oude Rijn (Old Rhine) by means of a canal and its mouth at the Hollandse IJssel was developed into a harbour. Castle Gouda was built to protect this harbour. This shipping route was used for trade between Flanders and France with Holland and the Baltic Sea. In 1272, Floris V, Count of Holland, granted city rights to Gouda, which by then had become an important location. City-canals or grachten were dug and served as transport ways through the town.