At the outbreak of the war, he enlisted for ninety days as a private in Company B of the 8th Illinois Infantry. Upon reorganization of the regiment as a three-year unit in July 1861, Lieb was elected captain and the following year was promoted to major. He fought at the battles of Fort Donelson, Shiloh and the siege of Corinth.