A Spirit Airlines flight from New York to Florida had to divert and make an emergency landing Thursday night, after something on the plane that smelled like "dirty socks" caused several people to get sick, WSOC reported.

>> Read more trending news

Spirit Airlines flight 779 made an emergency landing in Myrtle Beach, South Carolina and crews launched a hazmat investigation into the unknown substance.

At least 10 out of the 220 passengers on the flight were treated for headaches, nausea and difficulty breathing.

Nothing illegal or hazardous was found on board, Myrtle Beach Online reported.

The passengers finally reached their destination around 4:45 a.m. Friday -- about five hours later than the scheduled arrival time, according to Flight Aware.

A Spirit Airlines spokesperson told Fox News the source of the odor is being investigated.

"We apologize for the inconvenience this diversion has caused," the statement read. "At Spirit Airlines the safety of our guests and crew is paramount."