A resident of the Inwood apartment building where a fire killed three people last week was arrested Monday and charged with negligent homicide, police said.

Victor Arias, 29, was seen discarding a lit cigarette into cardboard boxes inside the building, causing them to ignite and setting off the deadly blaze at 207 Dyckman St. just after midnight on May 4, according to the FDNY and a criminal complaint. He was taken into custody at 12:30 p.m., the NYPD said.

Arias faces three counts of criminally negligent homicide, according to court records. He pleaded not guilty and was released with an electronic monitor and forced curfew of 9 p.m., according to the Manhattan district attorney’s office, which did not press for bail because Arias has a condition that requires regular and significant medical attention.

Prosecutors said in court, however, that not seeking bail does not diminish the fire's catastrophic consequences.

The fire tore through the six-story building, killed three people and injured 14 others, including a firefighter. More than 100 residents were displaced, prompting several GoFundMe campaigns to support survivors.

Court records identified the people killed as Lance Garcia, 24; Yolaine Bienvenida Diaz Dominguez, 48; and Ana Dominguez Lantigua, 72.

According to the criminal complaint, Arias entered the building and began smoking a cigarette on the stairs. He then tossed the cigarette on to a pile of cardboard boxes and walked upstairs.

Arias' lawyer declined to comment.

The arrest comes as scrutiny mounts on its owner over conditions inside the building. Just a week before the fire, the city's Department of Housing Preservation and Development sued the building's owner, JanJan Realty Corp., and its president, Jack Bick, over fire hazards at the adjoining property at 209 Dyckman St.

That April 27 lawsuit accused the company of maintaining "unsafe conditions as part of an intentional and aggressive campaign to harass and displace rent-stabilized tenants." The complaint cited obstructions to building exits, broken flame retardant in a common area and missing smoke and carbon monoxide detectors.

The 25-unit building where the fire began, also owned by JanJan Realty, had 107 housing code violations as of last week, including 39 deemed "immediately hazardous," according to city records.

Brick did not respond to a request for comment about the code violations.

The FDNY has launched a public campaign urging New Yorkers to close their doors in the event of a fire. The department released images from the fire that shows one room scorched by flames beside another left nearly untouched due to a closed door.