Kostelec was probably founded by King
Ottokar II in the second half of the 13th century. The first known owners of Kostelec were the Borš family from Osek, when the settlement was taken over by Ottokar II in 1270. The market town later belonging to Queen
Elizabeth of Bohemia became the
dowry town of Czech queens. The queen granted privileges to the town and the mill, relieved the town of some duties. There were many ponds around Kostelec. To the northwest stood a water fortress, which well fortified served as a castle.
Charles IV pawned Kostelec to his wife
Elizabeth of Pomerania. She gave the town other privileges, which Charles IV confirmed. Around 1364, the town was hit by a great fire, destroying many houses, after which it lost its town privileges. In the 15th century, Kostelec was owned by the
Berka of Dubá family, from whom the Queen
Joanna of Rožmitál, the widow of King
George of Poděbrady, purchased it. Under the rule of King
Vladislaus II, in 1486, Kostelec was promoted to a town. The Jewish community was established in Kostelec around 1505. It came to an end in 1940. Jews were mostly buyers, they bought houses in the town, the municipal council also reserved a cemetery for them. They introduced a school for children around 1717. In 1886, the granary was rebuilt into a synagogue, which was demolished after 1948. ==Demographics==