Of the ten bloodiest battles of the American Civil War , the Battle of Gettysburg in early July , 1863 , was by far the most devastating battle of the war , claiming over 51 thousand casualties , of which 7 thousand were battle deaths .