Severe thunderstorms in the region prompted the National Weather Service (NSW) to issue the brief warning for the Brooklyn and Queens boroughs of the city.

A flash flood warning remained in effect for a large swath of Brooklyn, Queens and Staten Island until 7.30 a.m.

Some social media users reported that the loud tornado warning had woken them up.

The National Weather Service sent the emergency alert to cellphones shortly after 4.30 a.m. on Tuesday. It expired at 5 a.m. on Tuesday without any reported sightings of tornados.

The emergency alert advised people to “take shelter now in a basement or an interior room on the lowest floor of a sturdy building.”

It added: “If you are outdoors, in a mobile home, or in a vehicle, movie to the closest substantial shelter and protect yourself from flying debris. Check media.”

“Between 1.5 and 3 inches of rain have fallen. Additional rainfall amounts of 1 to 1.5 inches are possible in the warned area. Flash flooding is ongoing or expected to begin shortly,” the NSW said in the alert.

On Twitter, the NWS’s New York office urged people to move immediately to higher ground and avoid walking or driving through flood waters. The warning affects more than 4 million people and almost 750 schools, the NWS said.

Heavy rain and severe thunderstorms are forecast to produce flooding and damaging winds across the northeast on Tuesday, according to the NWS’ Weather Prediction Center.

“Some thunderstorms have the possibility of becoming severe, especially over parts of eastern New York and into western New England, where a slight risk of severe thunderstorms is in effect,” it added.

“Damaging wind gusts, isolated hail and a brief tornado or two are possible this afternoon into the early evening.”

It comes after heavy rainfall in the Midwest on Sunday led to significant flooding, including in Chicago.

The Chicago area saw between 2.5 to 4.5 inches of rainfall on Sunday, Todd Kluber, a meteorologist with the National Weather Service, told the Chicago Tribune.

Many residents had their homes damaged by flooding.

By Monday afternoon, more than 1,900 service requests were made, including at least 1,570 that were about flooded basements, The Tribune reported, citing city data.

Chicagoans took to social media with videos of the torrential rain and flooding, including some that captured sewers spouting large amounts of water.