(CNN) A Virgin Atlantic flight headed to London from New York City was diverted to Boston after a small fire broke out in the first class cabin Thursday night, a passenger said.

The flight's 217 passengers were safely evacuated after the emergency landing, the Massachusetts State Police said. It said the flames may have come from a passenger seat that had an electrical malfunction.

Passengers smelled smoke coming from the first class cabin "not even 30 minutes" after the plane departed John F. Kennedy International Airport around 7:30 p.m., said Cory Tanner, 28, who was aboard the flight.

The crew announced the aircraft would make an emergency landing in Boston's Logan International Airport. Tanner said a flight attendant told him the smoke was from a TV unit that caught fire in the first class cabin.

In a statement, Virgin Atlantic Airways said an incident aboard the flight led to the plane being diverted as a precaution. It did not provide any details on the cause of the fire.

Read More