Petersburg was the supply center for Northern Virginia with five railroads meeting at one junction. Its capture meant the immediate downfall of Richmond. To protect Richmond and fight Grant at the battles of the Wilderness, Spotsylvania, and Cold Harbor, Lee was forced to leave Petersburg with minimal troop protection. After crossing the James River, the Army of the Potomac, without any resistance, marched towards Petersburg. After crossing the James, Grant rescued Butler from the Bermuda Hundred and sent the XVIII corps led by Brig. Gen. William F. "Baldy" Smith to capture the weakly protected Petersburg, which was guarded by Confederate General P.G.T. Beauregard. Grant established his new headquarters at City Point for the rest of the Civil War. The Union forces quickly attacked and overtook Petersburg's outlying trenches on June 15. However, Smith inexplicably stopped fighting and waited until the following day, June 16, to attack the city, allowing Beauregard to concentrate reinforcements in secondary field works. The second Union attack on Petersburg started on June 16 and lasted until June 18, when Lee's veterans finally arrived to keep the Union army from taking the important railroad junction. Unable to break Lee's Petersburg defenses, Grant had to settle for a siege.