MIAMI — Hurricane Dorian struck Puerto Rico with a glancing blow on Wednesday, bringing back difficult memories as the first big storm to threaten the island since Hurricane Maria tore through two years ago.

Dorian has been unpredictable, frustrating forecasters and paralyzing Puerto Ricans for days as they watched the storm track shift toward the island. At one point, it looked as if Dorian would cut an eerily parallel path to Maria’s destruction, albeit with far less intensity. Puerto Ricans lined up outside big-box stores to stock up on supplies and swamped a mental health hotline to get help with their anxiety.

[Here is the latest coverage on Hurricane Dorian as it heads toward Florida.]

“So many people are hysterical, and it’s because Maria was strong,” said Carmen Vargas, 54, a resident of rural Guaynabo, P.R., near San Juan, the capital, as she vividly recalled the 2017 storm. “Even though we know it’s not the same, the memories come back, and the wounds reopen.”

By Wednesday morning, the eye of the storm had veered toward the Virgin Islands, where Dorian’s drenching rain and whipping winds surprised residents who felt unprepared to face the Category 1 hurricane. By Wednesday afternoon, the storm had rolled into warm Atlantic waters, where it is expected to strengthen into a Category 3 hurricane that could begin battering the east coast of Florida as early as the weekend.