His first trial resulted in a conviction, but in a second trial he was acquitted. He was elected lieutenant governor of the state in 1872 and reelected in 1874, in which capacity he served as president ex officio of the S.C. Senate. Gleaves also served in the South Carolina state militia as a major and judge advocate in the First Brigade, colonel and aide to the governor, and colonel and judge advocate in the Second Division.