A giant drill bit nearly skewered an F train packed with passengers when an MTA contractor missed its mark while digging a well, officials said on Thursday.

The train, which was loaded with around 800 passengers, had just pulled out of the 21st Street-Queensbridge station in Long Island City around 11:45 a.m. Thursday when the drill came spiraling through the top of the tunnel and narrowly missed penetrating the top of one of the train cars.

The operator heard a thundering noise on the roof and stopped the subway with the emergency brakes — and then discovered the drill extending from the roof of the tunnel to the floor, which struck down just inches from the side of the train, officials said.

The bit, which measures 10 inches in diameter, shattered the glass of several of the train’s windows and gouged its steel frame, the MTA said.

Officials blamed contracting company Griffin Dewatering New England Inc. for the nearly tragic blunder, adding that the crew was working from above ground to extend an underground well as part of the East Side Access project.

The project will connect Long Island Rail Road with Grand Central Terminal.

“Somebody made a mistake; maybe a surveyor or a field engineer,” said a source. “They drilled into the street but didn’t realize they were right over the F train tunnel. They weren’t supposed to be in that spot.”

The passengers were forced to walk through a rescue train that pulled up behind the halted train which made it only 700 feet from the 21st Street station, and gave them passage back to the platform.

Stephanie Cruz, 21, of Queens was on the train, and said that riders didn’t know how serious the situation was.

“I wasn’t worried, I just assumed it was normal MTA crap,” said Cruz. “Something’s always breaking, you’re underground so you’re pretty much secluded from knowing if there is any real danger.”

She was then stunned when she saw the photos of what actually happened. “I’m like holy s–t.” she said. “It’s hard to believe that happened…How could someone screw up that bad?

Northbound F train service was halted for hours as the MTA investigated the bizarre mishap before being fully restored Thursday evening.

Workers from Griffin Dewatering, which could not be reached for comment, installed a steel plate to fill in the misplaced hole.