President Trump blocked the release of hundreds of long-secret records related to the assassination of President John F. Kennedy after receiving last-minute appeals from the CIA and FBI while allowing the National Archives to publish 2,800 others to the delight of researchers and conspiracy theorists.

In a memo citing “potentially irreversible harm” to national security, Trump said he had “no choice” but to block the remaining records, which he ordered placed under a six-month review and vowed to release on a rolling basis with “agency-proposed redactions” in the coming weeks.

“The American public expects — and deserves — its Government to provide as much access as possible to the President John F. Kennedy Assassination Records so that the people may finally be fully informed about all aspects of this pivotal event,” read Trump’s memo, which was released ahead of a hard deadline to honor a 1992 law mandating their release.

Officials also said Trump will impress upon federal agencies that “only in the rarest cases” should any of the files stay secret.

Researchers who waited decades for the files to be made public grew increasingly frustrated yesterday as the president’s decision, which he’s teased for weeks, came down to a last-minute debate with intelligence agencies, despite having months to prepare for disclosures that had been set on the calendar for 25 years.

Prior to the National Archives release, Larry Sabato, an authority on Kennedy, posted on Twitter, “The government has had 25 years — with a known end-date — to prepare #JFKfiles for release. Deadline is here. Chaos.”

Historians and others who have probed Kennedy’s Nov. 22, 1963, assassination in Dallas doubt the files will reveal a smoking gun that would support the raft of conspiracy theories that surfaced afterward, including the possibility of a second shooter, a magic bullet or the involvement of the CIA, FBI or the mob.

The official narrative formed by the 1964 Warren Commission concluded that a lone gunman, Lee Harvey Oswald, acted alone in firing the deadly shots that killed the president and that nightclub owner Jack Ruby acted alone when he shot and killed Oswald two days later.

But experts have indicated interest in what the government knew then and in the intervening months about Oswald’s trip to Mexico City prior to the assassination. There, he reportedly sought a Soviet visa and proclaimed his plan to kill Kennedy.

The trove of documents is expected to include documents on CIA agents and Soviet defectors, some of Oswald’s financial records and even personal notes from first lady Jacqueline Kennedy and FBI Director J. Edgar Hoover, experts predict.

There is hope the files could shed light on why Oswald, a former Marine who had briefly defected to the Soviet Union, wanted to kill the president.

About 88 percent of the total Kennedy assassination collection has been released so far, including 3,810 records the National Archive put out in July.

Experts say it will take weeks to mine the documents for new and interesting information.

And though experts aren’t expecting the 3,100 documents — comprising hundreds of thousands of pages — will contain any blockbuster revelations, Patrick Maney, a presidential historian at Boston College, said, “As long as the government is withholding documents like these, it’s going to fuel suspicions that there is a smoking gun out there about the Kennedy assassination.”

Herald wire services contributed to this report.