The incident happened at the Olympic Motor Lodge on Vanderbilt Parkway in Hauppauge just after 8 p.m.
Guests in 17 rooms rushed out quickly as firefighters worked to extinguish the flames.
No injuries were reported.
A motel guest admitted the fire began because he was smoking in bed, and the mattress caught fire.
The fire spread to adjoining rooms, and the motel suffered fire and water damage.
The Red Cross has relocated the motel's guests.
Get Eyewitness News Delivered