The campaign became a race between Lee and Sheridan, with Lee attempting to obtain supplies for his retreat and Sheridan attempting to cut him off, with the Union infantry close behind. At Sayler's Creek on April 6, nearly a quarter of the Confederate army (about 8,000 men, the majority of two corps) was cut off and forced to surrender; many of the Confederate supply trains, crossing the creek to the north, were also captured. Although Grant wrote to him suggesting that surrender was his last remaining course of action, Lee still attempted to outmarch the Union forces. In Lee's final attack at Appomattox on the morning April 9, John B. Gordon's depleted corps attempted to break the Union lines and reach the supplies in Lynchburg. They pushed back Sheridan's cavalry briefly but found themselves faced with the full Union V Corps. Surrounded on three sides, Lee was forced to surrender his army to Grant at Appomattox Court House that day, with the formal surrender ceremony taking place two days later.