castellan
A castellan, also known as a châtelain, was the keeper of a castle in the middle ages. His office and rank varied in various countries. In France and Flanders, the title castellan belonged to the holders of certain desmesnes, and was next in order of rank to that of a bailiff.