IOWA CITY, Iowa (AP) — The easy field goal that coach Kirk Ferentz didn't have to fake nearly cost Iowa the game.

The kick the Hawkeyes had to make wound up rescuing them from a devastating defeat — and saved Ferentz from getting excoriated from frustrated Iowa fans.

Miguel Recinos drilled a 41-yard field goal through a driving rain as time expired and Iowa beat Nebraska 31-28 on Friday despite blowing a 15-point lead in the second half.

Mekhi Sargent ran for a career-high 173 yards and scored twice for the Hawkeyes (8-4, 5-4 Big Ten), who have won four straight over the Cornhuskers for the first time.

"For us, this is a black and gold Friday," Ferentz joked.

The Hawkeyes came within inches of making it a black and blue Friday.

Iowa made the risky decision to fake a field goal at Nebraska's 3-yard line up 28-13 late in the third quarter. It failed, and it led to a 98-yard scoring drive from the Huskers to make it 28-20 with 13:57 to go.

"We were going for the kill. Simple as that," Ferentz said about holder Colten Rastetter's pass to T.J. Hockenson, which was stopped a yard short. "We felt like we could really push this thing through."

Adrian Martinez then ran it from 3 yards out with 3:22 left, and he used his feet to stay alive long enough to find Kade Warner — son of NFL Hall of Famer Kurt Warner — in the back of the end zone to tie it up.

But Hockenson found redemption with a 10-yard catch on a fourth-and-8 with 42 seconds to go. Recinos also came through on a last chance to redeem himself, putting it through the uprights after missing a 37-yarder with 7:54 left at the same end of the field.

"I kind of had a feeling after I missed that one that they were going to score again," Recinos said. "Right after the miss I just reset and just back in it to try and make that kick."

Sargent scored late in the second quarter on a 15-yard run and early in the third on a 5-yard pass from Nate Stanley to help the Hawkeyes jump ahead 28-13.

It felt like another easy wins over the Huskers was in order. But Nebraska and Martinez, their brilliant freshman quarterback, displayed some impressive resilience in nearly pulling off the comeback stunner.

"Adrian Martinez showed us that he's fearless," Nebraska coach Scott Frost said. "He made a lot of great plays late."

Instead, Recinos led his teammates around a drenched Kinnick Stadium in a celebration so raucous that Ferentz wound up with a large cut on his cheek courtesy of quarterback Nate Stanley's facemask.

Iowa's supporters then gladly waited in their yellow ponchos to shuffle out of the stadium, cheerfully signing along as "Who'll Stop The Rain" by Credence Clearwater Revival pumped through the speakers.

"I wish it was a little cleaner. But, I mean, to send the seniors out with a win, you can't ask for anything more," Iowa defensive lineman Anthony Nelson said.

Martinez threw for 260 yards and two TDs to lead Nebraska (4-8, 3-6), which went 0-5 on the road in 2018. The Huskers played without injured star wide receiver J.D. Spielman for the second week in a row.

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

More From KSOO-AM / ESPN Sioux Falls