Gradually, the war effort improved for the North, though more by attrition than by brilliant military victories. But by 1864, the Confederate armies had eluded major defeat and Lincoln was convinced he'd be a one-term president. His nemesis, George B. McClellan, the former commander of the Army of the Potomac, challenged him for the presidency, but the contest wasn't even close. Lincoln received 55 percent of the popular vote and 212 of 243 Electoral votes. On April 9, 1865, General Robert E. Lee, commander of the Army of Virginia, surrendered his forces to Union General Ulysses S. Grant and the war for all intents and purposes was over.