A wayward umbrella fell on the third rail during Monday’s winter storm — and that’s all it took to bring the entire 7 subway line to a halt and strand thousands of frustrated riders, officials said.

At least five jampacked trains were stuck between stations for almost three hours, causing a logjam in both directions that stopped travel on the elevated Queens line and sent commuters into the elements to find an alternate way to work.

“Someone dropped an umbrella on the track, it hit the third rail and knocked out the servers,” said Office of Emergency Management Commissioner Joseph Esposito.

“Then, what happened because of the nonrunning of the trains, an icing condition built up on the rails, so then we had to de-ice those rails.”

The incident took place as one to two inches of snow and ice fell on the city. Queens got walloped with three to six inches of snow and ice, and temps fell to as low as 13 degrees.

MTA officials said they were still working to determine the cause of the problem, and had not concluded with certainty that the umbrella was the culprit.

The operator of a Manhattan-bound train first noticed the black umbrella wedged under the third rail near the 52nd Street station in Woodside just after 9 a.m.

“It was about 15 feet ahead of the train and they announced that they had to shut down the power and wait for a crew member to grab it,” passenger Dan Lange told The Post. “They said if they hit it, it would set off an emergency switch on the train that would cause us to become stuck between stations.”

Once the power was cut, the workers carefully removed the umbrella.

But a short time later, the electrified third rail lost power for good as the ice piled up, crippling the entire line, Esposito’s agency said.

The stranded trains were eventually towed to nearby stations, where passengers departed at around 11:30 a.m.

Meanwhile, more cold weather was in store for the city Tuesday as temperatures will reach a high of about 29 degrees. Wednesday will see milder temps of around 44 degrees.