After his resignation from the U.S. Army, Longstreet was appointed a brigadier general in the Confederate army. In July 1861, he served at the Battle of First Manassas before he was promoted to major general. From April to July 1862, he served with distinction during the Peninsula campaign. He later participated in the battles of Second Manassas and of Antietam. In October, he was promoted to the rank of lieutenant general. Subsequently, he held Marye's Heights during the Battle of Fredericksburg. He was detached for service south of the James River, but he returned as the Army of Northern Virginia moved north to Gettysburg. In September 1863, he won a victory in the Battle of Chickamauga, however, failed in the Battle of Knoxville. During the Battle of Wilderness, he returned to the east to participate in the second day. He was wounded by his own men on accident, and he did not return to the field until the surrender at Appomattox Court House.