Ryan Ingram's 2-yard touchdown run 57 seconds into the final quarter gave Wofford a 29-26 lead.
Richard McCollum's 19-yard field goal capped a nine-play, 60-yard drive and pulled Western Carolina (4-5, 2-4 Southern Conference) into a 29-all tie with 6:55 remaining. The Catamounts defense forced a three-and-out and Landon Parker's 28-yard punt gave Western Carolina a first-and-10 on the Terriers' 40-yard line, setting up Williams' game-winning score.
Wofford (2-7, 2-4) led 14-12 at halftime after Jimmy Weirick connected with freshman Kyle Pinnix for a 13-yard touchdown with 4 seconds left in the second quarter.
Western Carolina's Carlos Davis completed 16 of 24 passes for 268 yards with touchdown throws to Raphael Williams covering 73 yards and an 8-yarder to freshman Censere Lee. Davis also rushed 15 times for 78 yards. Freshman Desmond Reid carried 20 times for 112 yards.
Weirick passed for 269 yards and a touchdown, completing 17 of 35 attempts.
More AP college football: https://apnews.com/hub/college-football and https://twitter.com/AP-Top25. Sign up for the AP's college football newsletter: https://apnews.com/cfbtop25
Copyright 2023 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.