CHAPEL HILL, N.C. (AP) After being close so many times, North Carolina finally got a victory.

Nathan Elliott passed for 308 yards and two touchdowns to help North Carolina beat Western Carolina 49-26 on Saturday.

Javonte Williams rushed for 93 yards and three touchdowns for the Tar Heels (2-8), who ended a six-game losing streak.

''I'm excited for our players,'' North Carolina coach Larry Fedora said. ''I really am. I'm excited that they're getting to enjoy tonight. I'm excited that there's some reward at the end of all their hard work.''

North Carolina amassed a season-high 654 yards in its first win since Sept. 22, when it defeated Atlantic Coast Conference Coastal Division champion Pittsburgh 38-35.

The Tar Heels had lost three games by seven points or less since then, two of which they led in the final two minutes of the fourth quarter.

''Everyone has just kept fighting,'' Elliott said. ''This locker room deserves that win.''

North Carolina senior walk-on Manny Miles, son of former LSU coach Les Miles, threw a 38-yard touchdown pass to Jake Bargas on a Hail Mary on the final play of the first half.

The Tar Heels led 35-16 at halftime despite throwing two interceptions, losing a fumble and failing to score on two of four trips into the red zone.

Western Carolina (3-8) ended its season with its eighth consecutive loss.

Tyrie Adams passed for 290 yards and rushed for 104 yards and two touchdowns for the Catamounts.

Will Horton made field goals of 43, 45, 33 and 26 yards for Western Carolina.

THE TAKEAWAY

Western Carolina: The overmatched Catamounts had little chance in this one as they limped to the finish line of their season, but they delivered a better performance than they did in their 65-10 loss at North Carolina last year.

''I thought our players played hard,'' Western Carolina coach Mark Speir said. ''They played to the finish. I said, `We can't control how many 4- or 5-stars they've got, or how many twinkle-little stars we've got, but we can control our effort and we can control our attitude and the heart we play with.'''

North Carolina: Near the end of a second consecutive rough season, the Tar Heels took out some frustration. North Carolina improved to 8-0 under Fedora against teams from the Football Championship Subdivision, winning those games by an average of almost 37 points per game.

HAIL MARY

Miles subbed in for Elliott at the end of the first half because he has a stronger arm and would be able to get the ball to the end zone. His pass was deflected in the end zone before Bargas caught it, setting off a wild celebration in which Miles sprinted down the field giving five to his teammates. The party continued after the game, where his father, mother and two sisters watched him answer questions.

''When you're a kid, you dream about playing college football, and you dream about scoring touchdowns and throwing it and running it,'' Miles said. ''For it all to happen at the end and for your first throw to be a touchdown like that, it's pretty awesome.''

MILESTONE PERFORMANCE

Adams became the 10th player in FCS history to pass for 2,000 yards and run for 1,000 yards in the same season. He entered the game needing 98 rushing yards to reach 1,000. After three quarters, he had 15 attempts for a net total of minus-3 yards. But he ripped off runs of 23, 11 and 23 yards on the first three plays of the fourth quarter, and he ran for 18 yards on the final play of the game to finish with 1,006 rushing yards for the season.

INJURY REPORT

North Carolina tailback Michael Carter departed midway through the first quarter after appearing to injure his right arm. He did not return. The Tar Heels also lost starting defensive tackle Jason Strowbridge, who limped off the field with an injured right leg in the second quarter.

UP NEXT

Western Carolina: The Catamounts begin getting ready for 2019.

North Carolina: The Tar Heels wrap up their season at home against rival North Carolina State, which has won three of the last four in the series.

Copyright 2018 by AP. Any commercial use or distribution without the express written consent of AP is strictly prohibited.