On January 19, 1865, Pegram married Hetty Cary in a well-attended ceremony in St. Paul's Church in Richmond. Among the celebrants was Confederate President Jefferson Davis and his wife, Varina. Less than three weeks later, Pegram was killed in action during the Battle of Hatcher's Run. His funeral was held in the same church where he had recently been married, with many of the same attendees. His younger brother William would be killed in some of the war's last fighting at the Battle of Five Forks in April.