Thunderstorms and heavy rain snarled transit and traffic Tuesday morning ahead of the morning commute.

A flash flood warning was in effect for parts of Brooklyn, Queens, and Staten Island through 7:30 a.m. and officials warned people not to drive through flooded roadways and to get to higher ground if necessary.

As the storm pushes further east, that warning remains in effect for parts of eastern Queens and Long Island through 8:30 a.m. The weather was so extreme in the tri-state area that at one point authorities even warned a tornado could touch down, though the risk of that had passed by 5 a.m.

Many New Yorkers woke in the early morning hours to loud cracks of thunder and pummeling rain.

The C, L, and R trains were suspended and partially suspended, and the A train was rerouted as crews cleared water from tracks, according to the MTA.

Parts of the Belt Parkway in south Brooklyn and the Clearview Expressway in Queens were temporarily shut down due to flooding. Both highways had reopened with residual delays by 6:40 a.m.

Several thousand people lost power in Brooklyn and Queens, according to the utility Con Edison.

Historic flooding from the remnants of Hurricane Ida a year ago revealed the striking dangers faced by basement apartment residents, though it wasn’t clear if they received any special warnings Tuesday morning. Tenant Nancy Valero, who lives with her family in an unregulated basement apartment in Woodside, said her apartment took on six inches of water in the early morning hours. She was woken up not by emergency warnings, but by her newborn baby’s cries for food.

“My baby woke up, I was going to get up to feed him but when I put my foot on the floor I felt all the water,” she said. “I thought no, no, I realized it was flooding.”

The family spent the early morning hours sweeping up the water, unplugging their electronics, moving them to higher ground. It wasn’t immediately clear how widespread basement flooding was in impacted areas. Other residents in East Elmhurst, an area badly hit by last year’s storm, remained dry, according to state Sen. Jessica Ramos.

A spokesperson for New York City’s Office of Emergency Management didn’t return a request for comment immediately.