MEXICO CITY — The strongest hurricane ever known to assault the Western Hemisphere slammed into Mexico’s southwest Pacific Coast on Friday, transforming hotels into makeshift shelters, shuttering schools, closing airports and sending inhabitants racing to bus stations to flee inland.

The storm, named Hurricane Patricia, packed winds of about 165 miles per hour as it struck land, having slowed considerably from earlier speeds of about 200 miles per hour as it spun toward a coastline dotted with tiny fishing villages and five-star resorts in cities like Puerto Vallarta.

As the outer wall of the hurricane swept over the coast in the afternoon, trees were quickly flattened, landslides tumbled along a major road, light poles were toppled and roofs flew off.

“You had to feel how the air trembled,” said Yael Barragan, a trucking service coordinator in the port city of Manzanillo, huddled in his home with five children and four other adults. When the wind started blowing, it was not long before a neighbor’s roof was in his backyard. “I saw it fly, and I saw it land in my patio,” he said.