In 1309, Malbork became the capital of the Teutonic State. Together with the Grand Master, a large number of monastic brothers came to Malbork, which required the reconstruction and expansion of the existing facility. The Middle Castle with a large refectory was built, then the grand master's palace, and then the Low Castle. A castle, a monastery, and a residence are three basic functions complemented by a well-organized economic and military base.