Well, well, well. The Gophers have themselves a quarterback situation.

Demry Croft replaced Conor Rhoda in the second quarter and threw three fourth-quarter touchdown passes in the Gophers’ 30-27 loss to No. 21 Michigan State on a rainy Saturday night at TCF Bank Stadium.

Rhoda led Minnesota to a pair of first-half field goals, but both came after two Michigan State turnovers — two big opportunities for the Gophers to seize control early.

So, with the Gophers trailing by 11 points in the second quarter, coach P.J. Fleck replaced Rhoda with Croft, who returned to the team last week after serving a two-game disciplinary suspension.

The Gophers dropped to 3-3 overall and 0-3 in the Big Ten in a game that was delayed 34 minutes before kickoff because of lightning.

Croft finished 11-for-20 for 163 yards and those three fourth-quarter TDs to Tyler Johnson. The sophomore, who began the season as the co-starter with Rhoda, also threw a first-half interception.

“It was a blessed feeling being out there with the guys,’’ Croft said. “... You’ve got to prepare every game like you’re going to get in. That’s how I approached it.’’

Fleck did not say whether Croft would start next Saturday’s game against Illinois, saying he would decide during the week.

“He showed resiliency,’’ Fleck said of Croft. “I think he’s come a long way. … He started moving the team, and I kept him in there. He continued to do that, so I continued to give him opportunities.’’

The Gophers had no answer for Spartans running back LJ Scott, who rushed 25 times for 194 yards and two TDs.

“They did what Michigan State does. They run the ball,’’ Fleck said. “They had a ton of success on the toss play. That’s what they do well.’’

The Gophers got a big break early when Michigan State punter Jake Hartbarger couldn’t handle a snap, and Minnesota’s Jaylen Waters recovered at the Spartans 3.

But Rhoda fumbled and lost 4 yards on first down and then threw two incompletions. That forced Emmit Carpenter to come in and kick a 25-yard field goal for a 3-0 lead with 10:41 left in the first quarter.

Michigan State responded quickly, driving to the Minnesota 23. The Gophers defense held, and the Spartans settled for Matt Coghlin’s 42-yard field goal for a 3-3 tie.

The Gophers turned the ball over on their next series, with Shannon Brooks fumbling a high handoff from Rhoda. Michigan State’s Kenny Willekes recovered at the Minnesota 8, and the Spartans scored two plays later on Madre London’s 3-yard TD run for a 10-3 lead.

“We weren’t supposed to hand it off,’’ Fleck said of the turnover.

The Gophers’ next possession showed promise with Brooks gaining 21 yards to the Minnesota 48 on a swing pass down the sideline. But on second-and-5 from the MSU 47, Rhoda’s knee hit the ground for a 5-yard loss as he stretched for the shotgun snap. The Gophers were forced to punt.

Safety Duke McGhee, back from a two-game suspension, intercepted Brian Lewerke on first down, and the Gophers had the ball at the Michigan State 34. On third-and-5 from the 29, Rhoda had Mark Williams wide open in the end zone but the pass sailed incomplete. Carpenter kicked a 47-yard field goal to cut the lead to 10-6.

The Spartans (5-1, 3-0) quickly made it 17-6, capping a six-play, 62-yard drive with Scott’s 24-yard TD run early the second quarter.

Michigan State added to its lead on its first possession of the third quarter, with Scott’s 33-yard run setting up Coghlin’s 35-yard field goal for a 20-6 advantage. The Spartans boosted the lead to 23-6 with a 16-play, 73-yard drive that took 9:13 and ended with Coghlin’s 25-yard field goal.

Through three quarters, the Gophers were outgained 291-124, including 171-39 on the ground.

Early in the fourth quarter, Gophers defensive tackle Steven Richardson forced a fumble by Scott that linebacker Thomas Barber recovered at the MSU 27. Two plays later, Croft found Tyler Johnson across the middle, and the sophomore made a juggling catch for a 28-yard TD reception with 11:55 to play. Michigan State’s lead was down to 23-13.

No problem for the Spartans, who got a 55-yard kickoff return by Connor Heyward to the Minnesota 40. Scott’s 6-yard TD run made it 30-13.

Croft responded by driving the Gophers 61 yards in nine plays, ending with a 17-yard TD pass to Johnson, cutting MSU’s lead to 30-20 with 5:20 left.

Michigan State recovered Minnesota’s onside kick, but the Spartans’ drive stalled and Coghlin missed a 45-yard field-goal attempt with 3:01 left.

The Gophers had life, and Croft hit Williams for a 22-yard gain to the MSU 45 on fourth-and-4. Croft then scrambled for 20 yards to the MSU 31 and hit Brooks for 22 yards to MSU 9 with 1:18 left. Croft’s 9-yard TD pass to Johnson with 1:06 left made it 30-27.

But Michigan State recovered the onside kick and ended the game with two kneel-downs.

“I am proud of the fight,’’ Fleck said. “We finished on the offensive side, did not finish on the defensive side. … We are making strides.’’