 Upon Alabama's secession from the Union, Baker enlisted as a captain in the Eufaula Rifles before being transferred to the 1st Alabama Infantry, where he was briefly stationed in Pensacola, Florida, before being sent to Tennessee in late 1861.Being elected colonel by a mixed regiment of soldiers from Alabama, Mississippi, and Tennessee in 1862, his unit fought in the Battle of New Madrid, where he was subsequently taken prisoner.Released in a prisoner exchange within several months, Baker was given command of the 54th Alabama Infantry, which he would lead during the battles of Vicksburg and Champion's Hill, where he was seriously wounded.