c. 1200, "chief household officer;" c. 1300, "justice of the peace," from Old French conestable (12c., Modern French connétable), "steward, governor," principal officer of the Frankish king's household, from Medieval Latin conestabulus, from Late Latin comes stabuli, literally "count of the stable" (established by Theodosian Code, c. 438 C.E.), hence, "chief groom."
For first element, see count (n.1). Second element is from Latin stabulum "stable, standing place" (see stable (n.)). Probably the whole is a loan-translation of a Germanic word. Compare marshal (n.).
Meaning "an officer chosen to serve minor legal process" is from c. 1600, transferred to "police officer" by 1836. French reborrowed constable 19c. as "English police."