The rain stopped at halftime of Minnesota United FC’s game against the Jacksonville Armada, but the storms on the field were only beginning. Of the five second-half goals that were eventually scored, three gave United a much-needed 3-2 victory Saturday night.

Minnesota led 2-0 and 3-1 but needed to hold on at the end of a wild second half to clinch a third consecutive victory.

The first two United goals, scored in a five-minute span, came with controversy. The first goal was from a questionable penalty kick, after Kalif Alhassan charged through the middle of the Jacksonville defense, then was slightly obstructed by a defender just as the goalkeeper reached the ball. Pablo Campos, who missed two excellent chances in the first half, calmly put away the resulting penalty.

The second United goal was, in some ways, a mirror image of the controversial call that led to Minnesota’s elimination in the 2014 playoffs. A corner kick deflected to a Jacksonville defender, who tried to clear the ball but instead gave it to United center back Tiago Calvano. Calvano was ruled offside but buried his chance, and while the assistant referee waved off the goal, the center referee overruled the call after talking with his assistant.

It was Calvano’s first goal for Minnesota after having one disallowed last season. “Always, with me, it’s a little bit hard to score,” he said, relieved. “Finally, when I score, the referee wants to not give me the goal.”

The Armada players were noticeably unhappy with the referee after both goals.

United coach Manny Lagos admitted that his team was fortunate. “The reality is, we might have gotten some calls,” he said.

Pascal Millien scored for Jacksonville in the 71st minute, which set the stage for the eventual game-winner from Miguel Ibarra. Campos fought through a defender in the center of the field, then played the ball wide for Ibarra, who buried a shot past onrushing goalkeeper David Sierra. “The third goal was huge, to give us that lift and momentum to make sure that they would have to score two,” said Lagos.

In the 83rd minute, a Jemal Johnson free-kick slipped through United goalkeeper Sammy Ndjock’s grasp, cutting Minnesota’s lead to 3-2. It led to a nail-biting finish for the National Sports Center crowd, but United held on and moved up to second in the NASL standings, behind only the New York Cosmos.