A man walked into the busy atrium of an Iowa public library, doused himself with flammable liquid and set himself on fire before the eyes of horrified onlookers, police said Wednesday.

“I will never un-see what I saw,” Mallory Young, 35, of Des Moines, told the Des Moines Register. “There were people in tears in my office, it was that disturbing.”

Victim David Smith, 36, died late Tuesday from the burns he sustained about four hours earlier in the enclosed hallway at the Des Moines Central Library, Des Moines police told The Post.

Young, who watched the tragedy unfold from an office building across the street from the library, said she saw police officers “spraying down” the man’s severely burned and discolored body before he was put in an ambulance.

Video obtained by the newspaper shows officials responding to the fire as people stand outside.

Smith had only been in Des Moines for two weeks prior to the incident and his last known address was in Anchorage, Alaska, Des Moines police spokesman Sgt. Paul Parizek said.

It was not immediately clear whether Smith — who had lived a “transient” lifestyle,” Parizek told The Post — was struggling with mental health issues. An investigation is ongoing, he said.

Library staffers and other people nearby helped put out the blaze, which shut down the location before it reopened early Wednesday.

“Thank you to staff and others for their quick actions, and to everyone visiting the library who assisted us in evacuating the building quickly and safely,” library officials tweeted late Tuesday. “No one else was injured and the library sustained no damage.”