While Slocum's advance was stalled at Averasborough by Hardee's troops, the right wing of Sherman's army under command of Maj. Gen. O.O. Howard marched toward Goldsborough. On March 19, Slocum encountered the entrenched Confederates of Gen. Joseph E. Johnston who had concentrated to meet his advance at Bentonville. Late afternoon, Johnston attacked, crushing the line of the XIV Corps. Only strong counterattacks and desperate fighting south of the Goldsborough Road blunted the Confederate offensive. Elements of the XX Corps were thrown into the action as they arrived on the field. Five Confederate attacks failed to dislodge the Federal defenders and darkness ended the first day's fighting. During the night, Johnston contracted his line into a "V" to protect his flanks with Mill Creek to his rear. On March 20, Slocum was heavily reinforced, but fighting was sporadic. Sherman was inclined to let Johnston retreat. On the 21st, however, Johnston remained in position while he removed his wounded. Skirmishing heated up along the entire front. In the afternoon, Maj. Gen. Joseph Mower led his Union division along a narrow trace that carried it across Mill Creek into Johnston's rear. Confederate counterattacks stopped Mower's advance, saving the army's only line of communication and retreat. Mower withdrew, ending fighting for the day. During the night, Johnston retreated across the bridge at Bentonville. Union forces pursued at first light, driving back Wheeler's rearguard and saving the bridge. Federal pursuit was halted at Hannah's Creek after a severe skirmish. Sherman, after regrouping at Goldsborough, pursued Johnston toward Raleigh. On April 18, Johnston signed an armistice with Sherman at the Bennett House, and on April 26, formally surrendered his army.