In the Middle Kingdom, the office became one of the most important ones at the royal court. At the end of the 18th Dynasty, the title lost its importance, although the famous Bay had this office. In the later New Kingdom the function of a treasurer was overtaken by the overseer of the treasury.