A six-alarm fire tore through an empty Chelsea building that has been under construction Tuesday, taking about five hours to bring under control, an FDNY spokesman said.

Firefighters responded to the blaze at 221 W. 17th St. just before 3 a.m., pouring water on the flames that spouted out of several windows in the building. A total of 44 units responded to the fire, which was brought under control by 7:55 a.m.

The fire appeared to have started by the fourth floor, with the blaze spurting out of those windows when firefighters arrived. The flames then quickly traveled to the upper floors and the roof.

By Tuesday afternoon, officials had taken precautions in case of a collapse, the spokesman said. Several surrounding buildings were evacuated as well.

No one was injured in the fire.

The site is listed as the future home of the Dorian Chelsea Residences, a 14-aparment luxury building.