CALGARY -- A  737 bound for Calgary from Cancun was diverted to Memphis early Tuesday evening, where it landed safely.

Sunwing flight WG596 declared a Mayday for smoke in the aircraft, which was possibly from a passenger's personal item, and which was extinguished prior to landing.

According to a tweet by a passenger on the flight, the cause of the smoke was someone vaping on the plane.

The flight landed safely in Memphis and taxied to the gate.

The flight departed Cancun at 4:51 Cancun time and was scheduled to arrive in Calgary at 7:45.

Sunwing issued a statement later, confirming the incident.

"We can confirm that sunwing flight WG596 on route from Cancun, Mexico to Calgary, Alberta was forced to make an emergency landing in Memphis, Tennessee due to reports of smoke in the cabin," it said. "It is believed that a passenger's vape pen may have been discharged accidently on board the aircraft.

"All passengers and crew members are safe, and there appears to be no damage to the aircraft.

"We are working with local authorities to investigate this matter further and are therefore unable to confirm any other details at this time. in the meantime we are in the process of dispatching an airplane from Toronto to Memphis to bring our customers back home to Canada."

Several passengers on the flight provided Twitter updates to CTV Calgary, where they said that Sunwing officials sold them blankets for three dollars each, then departed, leaving the passengers in the Memphis airport.

However, they also sang the praises of the Memphis airport staff, who broke out mattresses, blankets, pillows and provided pizza and got the wi-fi turned on in their waiting area to help pass the time until the flight home to Toronto arrived.