Jim Harbaugh and Michigan hung on to beat Rutgers in a triple-overtime thriller Saturday night, 48-42.

Michigan received a brilliant performance to save Harbaugh from suffering what could have been the worst loss in his coaching tenure with the Wolverines.

JIM HARBAUGH SCRUTINIZED AS MICHIGAN GOES BEHIND EARLY AGAINST RUTGERS

McNamara came in for Joe Milton with the Wolverines down 17 points in the first half and threw four touchdown passes and ran for one more in double overtime. He finished 27-for-36 with 260 passing yards.

McNamara and the rushing attack led by Hassan Haskins was clutch for Michigan. Haskins’ lone rushing touchdown came in the third overtime period and it proved to be the game-winner.

Rutgers got a gutsy performance from Noah Vedral and the offense.

NORTHWESTERN'S DEFENSE LOCKS DOWN WISCONSIN, PICK UP VITAL BIG TEN VICTORY

Down eight points in the fourth quarter, Vedral somehow found Aron Cruickshank for a touchdown with 27 seconds left to go down two points. Vedral then got a push into the end zone on the 2-point try to tie the game.

Michigan had a chance to go up three points in the first overtime frame but kicker Quinn Nordin missed the go-ahead field goal. On Rutgers’ next drive, Valentino Ambrosio would miss the potential game-winner to keep the game going.

On the next drive, Vedral lobbed a pass to the opposite side of the field and found Jovani Haskins for a 25-yard touchdown pass. Rutgers would go up a touchdown.

COASTAL CAROLINA KEEPS UNDEFEATED DREAM SEASON INTACT WITH CLOSE WIN OVER APPALACHIAN STATE

McNamara then found the end zone to tie the game and on Michigan’s next drive, Haskins would score the go-ahead score. Rutgers had a chance to answer but Vedral threw an interception on fourth down and ended the game.

Michigan’s defense stepped up when it needed to for the win and saved Harbaugh from some harsher criticism.

Harbaugh was hearing the boo birds on social media as the Wolverines went down 17-7 at halftime against the Scarlet Knights. Michigan had been used to beating Rutgers by large margins, having defeated them last season 52-0 and 42-7 in 2018.

CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM

It was a little bit tougher for the Wolverines on Saturday night.

Michigan improved to 2-3 on the season and Rutgers to 1-4.