On May 12, 1863, Grant established his headquarters at Dillon's Farm with Sherman's XV Corps. At Raymond, five and a half miles east along Fourteenmile Creek, McPherson's XVII Corps, with 12,000 men, defeated 3,000 Confederates under John Gregg. Grant heard the guns at Raymond and at sundown learned that McPherson had won. Realizing that Confederate forces were now on both his left and right flanks, Grant abandoned his planned movement north and ordered the army to wheel toward Jackson.