WILMINGTON, N.C. — The powerful first surges of Hurricane Florence hit the sandy beaches of the Carolinas on Thursday, swamping oceanfront homes and roads as hundreds of thousands of people evacuated in the hope of escaping a storm expected to dump up to three feet of rain and cause flooding at levels not seen here in decades.

Florence has been bearing down on the Carolinas for days, and it has expanded in size, with tropical-storm-force winds extending nearly 200 miles from the storm’s eye. The storm crossed the Gulf Stream on Thursday and slowed dramatically, to just 5 mph, as it approached land.

The National Hurricane Center’s forecast Thursday pinpointed Wrightsville Beach, N.C., for landfall of the eye. But it could aim north or south as it nears shore, and the massive storm could have catastrophic effects far from wherever it hits the beach.

“It’s looking a little grim,” said Kelly Starbuck, 48, a photographer who grew up on Wrightsville Beach, a town of about 2,500 people, as she stood on high ground about a half-mile inland and peered through a long lens at her family home, which was under a mandatory evacuation order.

Starbuck, wearing a yellow slicker against heavy winds and slashing rain that came in waves, stood next to the Dockside Restaurant and was alarmed by what she saw in her viewfinder. “This is low tide, and it looks like high tide,” she said. “I’m very nervous about that storm surge.”

As winds and rain picked up during the day and conditions quickly deteriorated, thousands of people moved into emergency shelters to ride out what officials have called “the storm of a lifetime.”

Dozens of North Carolina school districts were closed, as well as nearly all schools in the University of North Carolina system. Gov. Roy Cooper (D) said that about 12,000 people were in 126 shelters by Thursday evening, with more expected to be added. An additional 4,300 people were in 61 shelters in South Carolina, officials said.

Florence has been looming offshore, with its wind speed fluctuating; on Thursday it was downgraded to a Category 2 storm from a Category 4. That created some confusion and, officials feared, complacency.

“I’m not worried at all,” said Richard L. Ford, 34, smoking a cigarette outside one of Wilmington’s five shelters. “I find it funny that the storm of hysteria is bigger than the storm itself.”

Officials pleaded with residents across the Carolinas to treat the storm as a deadly threat. They said a storm’s category describes only its wind speed, and that the overwhelming flooding that could follow is a far greater threat. Forecasters warned that Florence was poised to create a dangerous storm surge of up to 13 feet in parts of North Carolina.

“Don’t relax,” Cooper said on Thursday. “Don’t get complacent. Stay on guard. This is a powerful storm that can kill. Today, the threat becomes a reality.”

Cooper said Florence would spread heavy rainfall across the state for days, even if the storm veers south and comes ashore in South Carolina: “We’re on the wrong side of this thing. This storm will bring destruction to North Carolina.”

In South Carolina, officials urged residents to prepare for wind, rain, extended power outages, downed trees and even potential mudslides as the storm hovers over the state and dumps millions of gallons of rainwater, as Hurricane Harvey did in the Houston area last year.

“This is still a very, very dangerous storm, not only on the coast but also in the interior of the state,” Gov. Henry McMaster (R) said.

“This is a different kind of hurricane,” he said. “This is not one that’s going to hit the coast and pass through quickly. This is one that’s going to hit the coast and stay, maybe for two days.”

More than 420,000 people in South Carolina had evacuated their homes by Thursday afternoon, McMaster said. He bluntly told people in the evacuation zones to leave quickly, saying: “Time is running out. And remember this, once these winds start blowing . . . it will be virtually impossible for the rescuers to get in to rescue you.”

Duke Energy said it would close a pair of nuclear power reactors at its Brunswick plant on the Cape Fear River, about four miles from Southport, N.C. The company said its procedures required closing the plants when facing sustained 75 mph winds, even though the plants were designed to withstand winds of more than 200 mph and a storm surge of 22 feet.

Florence is widely seen as a test for the Federal Emergency Management Agency, whose capabilities were stretched thin last year as it responded to three major hurricanes. The federal response was especially criticized following Hurricane Maria in Puerto Rico, which even a year later is still struggling to restore even basic services.

“We are truly pre-positioned as best we can be, based on what we know,” FEMA Administrator William “Brock” Long said during a briefing Thursday.

Long urged patience and warned that it would take time to recover from Florence.

“This is a very dangerous storm,” Long said. “We call them disasters because they break things. The infrastructure’s going to break, the power’s going to go out . . . but we are going to do everything that we can to push forward as quickly as we can to get things back up and working.”

Pentagon officials said about 7,000 service members, including 4,000 National Guard personnel, were positioned for the storm and that thousands more were prepared to deploy if needed. They said the military had made sites, including Fort Bragg, N.C., available to FEMA as staging areas for relief equipment and had put helicopters and high-wheeled vehicles at the ready in different sites in the southeast for search and rescue use.

Ships including the USS Kearsarge are at sea trailing the storm and will move toward shore to further support emergency response.

“We have quite literally surrounded the expected affected area with DOD capability that will be critical in hours and days following the storm’s impact,” said Air Force Gen. Terrence O’Shaughnessy, who heads U.S. Northern Command and the North American Aerospace Defense Command.

Thursday afternoon, President Trump tweeted that he had just been briefed on the storm and “FEMA, First Responders and Law Enforcement are supplied and ready. We are with you!”

Despite reassurances from FEMA and Trump, Florence’s fluctuations and course-change predictions have added to the difficulties of preparing for such a massive storm.

On Monday, with the storm appearing to shift south, McMaster, the South Carolina governor, ordered schools in Aiken County, near the Georgia line, to close for the rest of the week to free up shelter space for hurricane evacuees.

The next day, he rescinded the order when it appeared the storm was shifting north. But by Thursday morning, Florence had changed direction again and state officials were considering closing at least some schools again.

“One minute we’re at a high state of alert, the next we’re at a low state, but we can adapt to the situation,” said Capt. Eric Abdullah of the Aiken County Sheriff’s Office, who said officials were trying to stay flexible.

Some evacuees who have been displaced since Tuesday were increasingly growing impatient and anxious as reports about where the storm would hit, and how hard, have changed.

“It makes me feel worried. One moment, it’s going to be real bad; next moment, it’s slowing down. We’ve been here for two days,” said 68-year-old Pat White, who evacuated her home in North Myrtle Beach, S.C., to the nearby high school. “I want it to really start and get it over with so we know if people are going to be safe.”

Bill Berlino, 83, said he was skeptical of the news reports he’s seen about the hurricane. He said it’s as if weather reporters were competing to see who could issue the most dire predictions.

“We’ve wasted three days of discomfort and displacement,” he said.

About 470 evacuees were at North Myrtle Beach High School as of Thursday afternoon, and an additional 200 are expected to arrive, said Trevor Strawderman, the principal.

The high school is just a mile from the ocean, but it has been an evacuation center during at least eight hurricanes because it is located on elevated land, Strawderman said.

Many of the evacuees are workers from American Samoa and Jamaica who were contracted as housekeepers at Myrtle Beach’s waterfront hotels. Hotel companies house the workers at apartment villages and took them by bus to the shelter, Strawderman said.

Two of them, Itagia VeaVea, 25, and Karen Tominiko, 19, are not as anxious as the others because they are used to hurricanes in American Samoa. They have also been praying, singing songs in their native language.

“It helps us calm down,” ­Tominiko said. “It’s a getaway to not think about the hurricane.”

Some people have decided to simply ride out the storm at home.

Late Thursday afternoon near the Dockside Restaurant, just across the Intracoastal Waterway from Wrightsville Beach, a group of about a dozen homeowners stood under a pergola amid sheets of rain.

Jack Kilbourne, 52, and his son Charlie, 13, were among the group of neighbors who live in large homes overlooking the waterway. Kilbourne said the houses sit 18 to 30 feet above sea level, so they were not worried about the storm surge.

“We’re prepared,” Kilbourne said. “Our main concern at our home is trees coming down. We’re not panickers. Anybody you see left here are not panickers.”

Berman and Kevin Sullivan reported from Washington. Phillips reported from Myrtle Beach, S.C. Joel Achenbach and Missy Ryan in Washington and James Folker in Edgefield, S.C., contributed to this report.