A massive construction crane collapsed onto the Tappan Zee Bridge Tuesday afternoon, injuring five and shuttering the span to traffic.

The crane was in use at the time, drilling pilings for the state’s $3.9 billion Tappan Zee replacement project, when it toppled off the new bridge. The boom of the crane crumpled over all seven lanes of the old span as traffic motored below.

With low traffic volumes on a weekday afternoon, officials said drivers managed to avoid hitting the crane entirely. A total of three commuters and two bridge workers suffered minor injuries. Drivers waited on the span for four hours before being diverted.

“Miraculously there were no serious injuries whatsoever,” said Gov. Andrew Cuomo, who visited the site of the collapse on Tuesday afternoon. “If there’s a silver lining in this situation, it’s that no one was seriously hurt.”

It was not immediately clear what caused the crane, one of 28 operating on site Tuesday, to collapse as it performed what officials considered a routine task. Cuomo said there would be an investigation into the cause of the fall as well as an inspection on all cranes in use.

“We’ve driven thousands of piles out here,” said Tappan Zee Constructors president Terry Towle. “Until we have a full investigation we really don’t know why this had an issue ... Obviously, it’s one of three issues: a problem with the crane, a problem with the hammer, or operator error.”

Towle said wind wasn’t a factor in the crash, which he said involved a “new” crane that had been hoisting a 121,000-pound vibratory hammer used to drive bridge pilings into the ground.

The old Tappan Zee suffered surface and structural damage to its southernmost lane. After a safety inspection, Cuomo said that, while the surface damage was “significant,” it was not enough to keep the bridge from reopening.

“The damage was significant, but it was not expansive,” Cuomo said.

Debris was completely cleared from the span as rush hour approached. The New York State Thruway Authority opened three northbound lanes by about 5:15 p.m.. One southbound lane was scheduled to open at around 7 p.m. with a second lane to open at 8 p.m. The southernmost lane will remained closed until repairs can be made.

The Tappan Zee was built in 1955, connecting about 138,000 vehicles per day between Rockland and Westchester counties over the Hudson River.

The construction of the replacement bridge is the largest bridge and highway infrastructure project in the country. Cuomo said the crane collapse shouldn’t delay the anticipated opening of the new Tappan Zee in 2018. Crews are expected to continue work on the bridge through the night.

Transit accommodations are planned for the evening rush hour. The Rockland County Department of Transportation is managing several mitigation routes for Tappan Zee Express bus service.

NJ Transit expects an increase in ridership this evening, but spokeswoman Lisa Torbic said that it doesn’t anticipate the need to adjust service. The agency announced on Twitter Tuesday afternoon that NJT and private carrier bus tickets and passes will be cross-honored on its Pascack Valley Line.

The Port Authority has cancelled a planned overnight closure of the George Washington Bridge’s lower level for an ongoing overnight repair and repaving project, to accommodate an expected increase in traffic.