Flames were seen going through the roof of the three-story building at the Lyv Six Forks apartments in north Raleigh on Monday night.
Gusty winds were an issue as firefighters worked to get the fire under control.
Six apartments were significantly damaged, but no one was hurt.
Approximately 60 firefighters fought the flames.
One woman said she was on a walk when she noticed the burning building.
"So I ran further up the hill, and the flames that I saw were raging," said Tara Wiselove. "They were taller than the building, coming out of the top floor. Trees were on fire."
She said she also saw people running into and out of the building and spoke to a woman who knocked on all the doors to make sure everyone was out of the building.
On Tuesday, the Raleigh Fire Department said the fire was caused by someone "not properly throwing away materials" after smoking.
Download the ABC11 News app