late 14c., "official in charge of accounts in a king's household," from Anglo-French contrerolleour (late 13c.), Old French contrerelleor (Modern French contrôleur), from Medieval Latin contrarotulator, agent noun from *contra-rotulare (see control (v.)).
Broader sense of "officer who examines accounts and manages finances of a corporation or institution" is from c. 1400. The first syllable was confused with count (v.), Latin comptus (hence comptroller). Mechanical sense "that which governs or restrains" is from 1867.