CHAPEL HILL, N.C. (AP) Amid all its ups and downs this season, North Carolina has at least proven it can come up with big last-minute plays to win games.
On Saturday, that even included the Tar Heels' woeful defense.
T.J. Logan scored from 1 yard out with 50 seconds left, then Shakeel Rashad recovered a fumble near midfield to seal the Tar Heels' 40-35 win against Pittsburgh.
Logan's short scoring run capped a 75-yard drive and marked his second go-ahead touchdown in the final minute of a game this season for the Tar Heels (5-5, 3-3 Atlantic Coast Conference), who rallied from 14 down early and withstood the latest huge performance from league-leading rusher James Conner.
''They keep practicing hard,'' coach Larry Fedora said. ''Their attitudes are good. They believe and they believe in each other. As long as they do that, we'll be fine.''
Marquise Williams had a big day for UNC, running for 122 yards and three touchdowns while throwing for 276 yards and a score. He calmly led that final drive with a couple of clutch plays, including a fourth-down keeper when the Tar Heels opted against trying a 46-yard field goal while trailing 35-34.
Then, after Logan's score, Pitt quarterback Chad Voytik fumbled on a keeper after Malik Simmons' hard hit that flipped Voytik over. Rashad pounced on the loose ball with 15 seconds left, the clinching stop for a defense that ranks among the nation's worst statistically.
''We had a lot of adversity throughout the game and sometimes it gets the better of us with big plays or whatever,'' Rashad said. ''But we fight back and when it really comes time to bow our necks and make a play, I think we're pretty good at doing that.''
That included hanging in against the tailback Rashad described as ''250 pounds of adversity.'' Conner ran for 220 yards and four touchdowns, including the 22-yard score with 3:33 left that gave Pitt (4-6, 2-4) the 35-34 lead.
But that plenty of time for the Tar Heels, who were in that exact position less than a month earlier.
In the last home game, Georgia Tech went ahead on a 75-yard reverse with 3:07 left, before Williams led the go-ahead drive for the winning score with 11 seconds to go.
Logan had the winner there, too, scoring from 2 yards out for the 48-43 win.
''I felt like when they went down and scored, just like Georgia Tech, we just pulled together,'' Logan said. ''Nobody was blaming anyone. We knew we had to score and we did it.''
The teams each entered needing two wins in the final three games to become bowl eligible. Now the Tar Heels are a win closer, while the Panthers must beat both Syracuse and Miami.
''I thought there was a lot of fight in our group,'' Pitt coach Paul Chryst said. ''Guys put it out there but didn't find a way to get a victory.''
Conner scored from 56 yards out on the game's first possession, then added scoring runs of 16 and 2 yards before breaking four tackles and dragging two defenders the final few yards on his last TD. Along the way, he set ACC and program records for most season rushing yards by a sophomore.
Conner now has 21 rushing touchdowns this season, tying the ACC single-season record.
Tyler Boyd also had a big day for Pitt, catching five passes for 160 yards and a 50-yard score, as Pitt finished with 523 total yards.
Ryan Switzer had a 63-yard catch-and-run touchdown early in the third quarter for the Tar Heels. Logan ran for 92 yards in a short-handed backfield, with tailback Romar Morris suspended one game after a recent DWI arrest, freshman Elijah Hood missing a fourth straight game with an injury and sophomore Khris Francis injuring his right leg on a kickoff return.
The Tar Heels were also without linebacker Travis Hughes because of an unspecified violation of team policy.
Follow Aaron Beard on Twitter at http://www.twitter.com/aaronbeardap