Gov. Phil Murphy has declared a state of emergency in New Jersey as Hurricane Erin, while staying hundreds of miles off the Jersey Shore, brings rough surf, windy conditions and the potential for widespread coastal flooding to the region.

MORE: Hurricane Erin brings waves crashing onto these Jersey Shore boardwalks

“Life-threatening rip currents will be present at all ocean beaches across the state,” Murphy said on social media Thursday. “Absolutely no one should be in the water today or tomorrow. Dangerous surf and rip currents are expected over the next several days.”

“Stay safe, New Jersey,” the governor added.

The state of emergency went into effect at 2 p.m. Thursday and covers all 21 counties in the Garden State.

“Over the past couple of days, we have seen the effects of Hurricane Erin along the Jersey Shore in the form of dangerous rip tides. Today and tomorrow will be no exception,” Murphy said this afternoon when he issued the state of emergency.

“As the storm moves past New Jersey over the next 24 hours, we are expecting high surf and rip currents, coastal and flash flooding, and a high erosion risk in parts of the state. We ask all New Jerseyans to monitor local weather forecasts and warnings and stay informed on evacuation protocols, especially if you’re down the Shore.”

NJ beach closed by Hurricane Erin impactsRed flags, yellow tape and special signs warn beach-goers in Ocean Grove that the entire beach is closed through Friday morning because of the powerful waves, strong rip currents and gusty winds expected from the off-shore Hurricane Erin.Natalie Paterson | NJ Advance Media for NJ.com

Most beaches in New Jersey have posted red flag warnings, meaning swimming is off-limits.

Some beaches, including Cape May, are flying double red flags — indicating the serious threat posed by the crashing waves and powerful rip currents being generated by the off-shore hurricane.

Ocean Grove is among several Shore communities that have closed their entire beach through Friday morning.

Moderate flooding is forecast for coastal waterways in Atlantic, Ocean, Monmouth and Middlesex counties, with minor flooding likely along the Delaware River from Trenton south.

The National Weather Service said Thursday evening’s high tide will bring the greatest risk of flooding, because of Erin’s fierce wind gusts pushing ocean water onto land and also because tides are already running high because we are approaching the new moon phase.

Your browser does not support the HTML video element.

This is a satellite view of Hurricane Erin spinning in the Atlantic Ocean at about 9:30 a.m. Thursday, Aug. 21. The center of the storm was a few hundred miles away from Cape May, N.J. (NOAA)

A coastal flood warning will for Atlantic, Cape May Cumberland, Middlesex, Monmouth and Ocean counties Cape May County runs until 2 a.m. Saturday.

In Gloucester, Camden and northwestern Burlington counties, a coastal flood watch runs from 11 p.m. Thursday until 2 a.m. Saturday,

There’s also a high risk of rip currents and high surf advisories in effect for the entire Jersey Shore through Friday.

Winds of 25 to 35 mph along the Shore could gust as high as 50 mph.

A wind advisory will be in effect from 10 a.m. to midnight Thursday in Atlantic, Cape May and Ocean counties.

As of 2 p.m. Thursday, Erin’s center was spinning about 285 miles east of Cape Hatteras, North Carolina with maximum winds of 100 mph. It’s moving northeast at 18 mph with gradual weakening expected over the next couple of days.

At its closest pass today, Erin’s center is expected to be spinning about 350 to 400 miles southeast of Cape May. Even though the strongest part of the storm will be very far from New Jersey, Erin is so large that it’s outer bands will be bringing gusty winds and dangerous waves to the Shore.

NJ Advance Media staff writer Len Melisurgo contributed to this report.

Jeff Goldman may be reached at jeff_goldman@njadvancemedia.com.

Our journalism needs your support. Please subscribe today to NJ.com.

If you purchase a product or register for an account through a link on our site, we may receive compensation. By using this site, you consent to our User Agreement and agree that your clicks, interactions, and personal information may be collected, recorded, and/or stored by us and social media and other third-party partners in accordance with our Privacy Policy.