A man was nearly swept into an arriving New York City subway train after a platform was flooded by rushing rainwater, and the terrifying incident was caught on video.

The clip, posted to social media on Thursday, shows a temporary wall collapsing as rainwater engulfs the Court Square - 23rd St station in Queens. The flooding appears to knock a man down and sweep him across the platform just as a train approaches the station.

The Metropolitan Transportation Authority said in a statement that the flooding was caused by inadequate drainage from a private developer building a residential tower adjacent to the subway station.

"This was an absolutely unacceptable and avoidable incident caused by a contractor working on a residential development project that could have put lives at risk," the statement said. "We have already begun taking steps to make sure the developer and contractor are held accountable and this doesn’t happen again."

The transit authority said it has no reported injuries from the incident and regrets that customers "were inconvenienced and put at risk by this contractor’s shocking lapse in best safety practices."

A series of isolated thunderstorms slammed the tri-state area on Wednesday, triggering 500 lightning strikes in the New York City area in the span of just 15 minutes, NBC New York reported.

The MTA said in its statement that the contractor agreed to restore proper pumping to the worksite adjacent to the station and to build additional protections, including a dam and a new wall and waterproofing.