A custodian threw out an unfinished cigarette into a trash can at a New Jersey elementary school, starting a blaze that burned down the building, prosecutors say.

The custodian, Jerome Higgins, was charged with smoking inside the James Monroe Elementary School in Edison, according to the Middlesex County Prosecutor's Office. The charge is a petty disorderly offense.

Higgins told NBC 4 New York it was "clearly an accident."

"I don't know what to say," he said. "I would do anything for those kids."

The flames broke out at the front and rear of the school just before 8 p.m., officials said. Firefighters from several New Jersey towns battled intense winds for three hours until the fire was brought under control.

Higgins also spoke to NBC 4 New York on Sunday night after the fire.

"I thought it was a basic trip of the alarm and I would come and reset it, but I couldn't believe how much of it was engulfed," he said. "I couldn't come within 100 feet."

No one was inside the school at the time.

Officials said about 500 students, kindergarten through fifth grade, attend the single-story school, which was celebrating its 50th anniversary this year. District officials said they were hopeful that the school would be rebuilt, noting its importance to the community.

The district plans to hold classes at an area community college until permanent arrangements can be made. Officials said they decided to keep students together in the short term and that they couldn't place them in other, already-overcrowded, district schools.

There are no classes for students enrolled in the school Monday and Tuesday. School will reconvene on Wednesday in classrooms at Middlesex County College. Busing will be provided, and textbooks and supplies are in place.

"It's going to be an adventure for them, and I think we're ready to move forward with that," the principal said at a meeting for parents Monday.

Superintendent Dr. Richard O'Malley added: "We will rebuild this school because our community deserves it."

On Sunday, former students and community members said they were shocked by the destruction.

"I almost broke into tears last night because it's my childhood," said one former student who is now an adult. "I can still vividly see all the memories we've had here."

Counseling services will be available at Edison Education Center, at 312 Pierson Ave.