Residents and hotel guests who were evacuated from several Midtown buildings after hurricane winds damaged a skyscraper crane last week were finally allowed back into the area last night.

People had been evacuated in and around 157 W. 57th St. as Hurricane Sandy made landfall Oct. 29 and broke the boom arm on the crane there, leaving it dangling 90 stories above, on the city’s soon-to-be tallest luxury residential building.

The damage forced more than 900 guests to flee from the nearby Le Parker Meridian hotel and displaced residents from Sixth to Eighth avenues and from 56th to 58th streets.

Yesterday, the city announced that it had secured the crane and that weary residents were allowed to return home.

“The nightmare is over,’’ said one exhausted but elated woman as she walked into the Briarcliff condo building at West 57th Street and Seventh Avenue.