He immigrated at a young age from Ireland in 1846, initially working as a storekeeper in Philadelphia and later as a clerk in New York City.
Gwyn led that regiment through many of its 39 recorded battles, including engagements at Seven Pines, Fredericksburg, Shepherdstown, Five Forks, Gettysburg, and Appomattox Court House.
Gwyn was wounded at the Battle of the Wilderness in 1864, but returned to service after recuperating to take command of the Third, and eventually the First and Second Brigades of the First Division of the Union Army's V Corps.
His brother, Hugh Garvin Gwyn, would later serve in the Confederate States Army as a major with the 23rd Tennessee Infantry Regiment, as well as an adjutant to General John Hunt Morgan.
[6][7] On November 4, 1846, Gwyn arrived in America via the Port of New York, 22 days before his 18th birthday, although his immigration papers list him as 20.
[12] Records show that on April 28, 1857 'James Gwyn & Lady' from Philadelphia visited the Imperial Hotel Belfast until at least July 2.
[14] Gwyn enlisted in Company G of the 23rd Pennsylvania Volunteer Infantry on April 21, 1861, one week after the American Civil War began.
The 118th, which was commissioned by the United States Department of War for three years of service, gathered recruits from the Philadelphia area during August 15 to 30,1862.
[18] Having gathered 1,296 volunteers during the two-week period, the "Corn Regiment" left for Washington, D.C., to be assigned a position in the Union Army on September 1, 1862.
[20] On September 28, 1862, Gwyn sent a letter to Colonel Barnes stating that the 118th Regiment did not provide the Philadelphia Inquirer with information that the paper used to publish a map and a report of the incident.
[19] The Fifth Army Corps resumed activity on June 10, 1863, as it began to travel northward through enemy territory, with skirmishes frequently occurring.
[18] Gwyn served perfunctorily while in command of the 118th Regiment for the ensuing five months with no notable confrontations until the Battle of the Wilderness in May 1864.
[27] Gwyn, having returned to active duty by this time, led the 118th in the Siege of Petersburg and Richmond campaign that lasted from June 9, 1864, to March 25, 1865.
[30] The next day, the combined Union troops moved forward along the railroad until they joined the Second Division, led by General Romeyn Ayres.
[31] It was recorded in this time the regiment suffered heavy losses and according to Frank H. Taylor, "Grant was remoselessly wearing out the besieged enemy.
[29][32] At a two road junction in the afternoon, near Fort McRae, Gwyn's leg was severely wounded when his horse fell upon him, though, did not permanently cripple him or lead to amputation.
[33] Captain Wilson, the 118th second-in-command assumed command and pressed on with Ayres offensive that eventually led to a Union victory late in that evening.
[28] The Federal Government approved of the idea and issued Special Order 347 on October 14, 1864, in which James Gwyn was awarded the grade of brevet brigadier general of volunteers, to rank from September 30, 1864, by President Abraham Lincoln.
[28] On December 14, General Ayres sent a report praising Gwyn's 'prompt' and 'efficient' service during the Battle of Globe Tavern, August 18–21, 1864, to the Fifth Army Corps.
The Assistant Adjutant, Major General Locke, ordered Gwyn to reform the Third Brigade and to take on stragglers from assorted Maryland regiments.
[43] Three days later, Gwyn wrote his own letter with names of soldiers who he thought were deserving of merit for their exceptional service during the Battle of Hatcher's Run.
[43] The Third Brigade fell back for over a month engaging in skirmishes around Hatcher's Run, Halifax road, and Rowanty Creek as part of the Richmond Campaign.
[44][45] Major operations resumed on March 31, 1865, when Gwyn led the Third Brigade in the Battle of White Oak Road, and eventually on to Five Forks, Dinwiddie County, Virginia.
[48] At the Appomattox Court House, on April 9, 1865, Robert E. Lee surrendered to Ulysses S. Grant, thus ending the Civil War.
[4][52] On June 9, a large banquet was prepared in their honor by the Corn Exchange, the same bank that offered the initial payments for recruits to join years before, at Sansom Street Hall for the members of the former 118th Regiment, who had returned to Philadelphia.
[19][52] According to his obituary, Gwyn was offered a position as a lieutenant in the regular army by President Andrew Johnson, but instead chose to return to civilian life.
He returned home to his wife Margaret and daughters Elizabeth and Matilda, now five years older than the last time he saw them.
[11] Gwyn died in the late evening of July 17, 1906, while visited his daughter, Mrs. Frank L. Rehn (Margaret), at her home in Yonkers, New York.