Prior to 2018, the fifth district was located in north-central Pennsylvania and was the largest in area, and least densely populated, of all of Pennsylvania's congressional districts. It was Republican-leaning and represented by Glenn Thompson (R). However, in February 2018, the Supreme Court of Pennsylvania redrew this district after ruling the previous congressional district map unconstitutional due to partisan gerrymandering, assigning its number to a more left-leaning district in southeastern Pennsylvania for the 2018 elections and representation thereafter–essentially, a successor to the old seventh district. Most of Thompson's territory became a new, heavily Republican 15th District. He was re-elected there.