MINNEAPOLIS (AP) — After a sluggish start, Jordan Murphy cleared his head and put his team on his back, and Minnesota narrowly avoided a second straight bad loss.

Murphy scored 19 points and tied a career high with 21 rebounds as the Gophers rallied past Penn State 65-64 on Saturday night.

Amir Coffey and Eric Curry each scored 11 points and Dupree McBrayer's free throw with 2.7 seconds left provided the winning margin for the Gophers (14-4, 4-3 Big Ten), who escaped a repeat of Wednesday night when they lost by 27 at previously winless Illinois.

Lamar Stevens scored 27 points, while Mike Watkins added 10 points and nine boards for the Nittany Lions (7-12, 0-8), who lost for the second straight game after leading at halftime.

Murphy was held to four points and four rebounds in the first half as Penn State took a 38-30 lead at the break. A conversation with coach Richard Pitino helped him regain focus and led to a huge second half for the senior forward.

"Coach just told me to keep my mind on rebounding because I was too much in my head in the first half," Murphy said. "He just told me to keep my mind on rebounding, just getting stops, then everything else would follow, so that's what I did."

Pitino praised his team for not letting one bad loss snowball into a losing streak that could derail a promising season.

"We had to look ourselves in the mirror. When you lose like that, the way that you lose and you don't compete, that's a problem," Pitino said of the Illinois game. "Even today, we weren't an offensive masterpiece by any means, but we fought and we got tougher as the game went on."

Minnesota trailed by 11 early in the second half, but began its comeback with an 18-5 run that included four straight missed free throws by Penn State. When Coffey hit three straight free throws, the Gophers had their largest lead of the game at 61-54 with 5:43 to play.

But Stevens scored on a putback that started a 7-0 run for the Nittany Lions to tie the score and set up a see-saw finish that came down to the last shot.

Stevens had a chance to put Penn State on top but he missed a pair of free throws with 2:40 to play. Minnesota then regained the lead when Murphy went 1-for-2 from the line on the other end.

Murphy pushed the Gophers' lead to 64-61 when he dunked home his own missed shot with a minute to play. But Stevens tied the game with 11.1 seconds left when he converted a three-point play after drawing a foul on Murphy and scoring down low.

On the Gophers' final possession, McBrayer drove to the hoop and drew a foul with 2.7 seconds to play. He hit the second of two shots to give Minnesota the lead, and Stevens missed an 18-foot shot at the buzzer to give the Gophers the victory and Penn State another frustrating loss.

"I thought we deserved to win this game," Penn State coach Patrick Chambers said. "We played well enough to win this game on the road. I think free throws, again, were our Achilles heel, really hurt us. So we've got to keep working on free throws. They made theirs."

The Gophers hit 17 of 21 free throws in the second half while the Nittany Lions went 9 for 16.

Stevens scored 17 points in the first half and the Nittany Lions shot 56 percent from the floor — including 5 for 8 on 3-pointers — en route to a 38-30 lead at the break.

But Minnesota held Penn State to 28 percent from the field in the second half as the Gophers recovered from their Illinois hangover just in time.

"We're gonna have to win ugly," Murphy said of the message Pitino gave the team at halftime. "That's something that I think we all embraced going into the second half, and I think that we all made it our duty just to get stops."

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

More From KXRB