President Trump delayed on Thursday evening the release of thousands of pages of classified documents related to the John F. Kennedy assassination, bowing to pressure from the CIA, FBI and other federal agencies still seeking to keep some final secrets about the nearly 54-year-old investigation.

The president allowed the immediate release of 2,800 records by the National Archives, following a last-minute scramble to meet a 25-year legal deadline. After lobbying by national security officials, the remaining documents will be reviewed during a 180-day period.

In a memo released by the White House, Trump said: "I am ordering today that the veil finally be lifted. At the same time, executive departments and agencies have proposed to me that certain information should continue to be redacted because of national security, law enforcement, and foreign affairs concerns. I have no choice — today — but to accept those redactions rather than allow potentially irreversible harm to our nation's security."

Early Friday morning, the president, who has trafficked in conspiracy theories himself, tweeted assurances that he wants to disclose as much as possible: JFK Files are being carefully released. In the end there will be great transparency. It is my hope to get just about every thing to the public!"

The records were put online at 7:30 p.m. The thousands of field reports, cables and interview summaries from dozens of FBI, CIA and congressional investigators reveal the minutiae of a chase for information that spanned decades and covered continents. Usually typed, stamped "Secret" and often annotated by hand, the files are a paper trail of detective grunt work, leads exhausted, dead-ends encountered, sources checked and rechecked.

Many of the files highlight the desperate search for Lee Harvey Oswald's possible connections to communists, Cubans, or both in the months before he shot Kennedy on Nov. 22, 1963.

Several show the FBI's often extraordinary efforts to identify suspected communists in the United States. Dozens of them amount to brief records on individuals whose names were drawn from the mailing list of a publication called "The Worker."

Some documents summarize internal discussions within Communist Party meetings after the assassination, discussing whether Oswald was innocent and whether communists would be blamed for Kennedy's death. Agents ran down rumors from prisoners and poets.

One FBI memo from April 1964 details Director J. Edgar Hoover's interest in connecting key players. He tells the New York field office to check out a tip that, prior to the assassination, "a meeting took place at Jack Ruby's Carousel Club in Dallas," attended by Ruby, a man whose name is illegible, and Dallas Police Officer J.D. Tippit, who was shot by Oswald as he fled from the scene of the Kennedy shooting.

Oswald, a troubled former Marine who had temporarily defected to the Soviet Union at one point, was killed by Ruby at Dallas police headquarters on live television — a stunning turn that fueled decades of conspiracy theories.

The government was facing a Thursday deadline for disclosing the records, and Trump had tweeted twice that the documents would be made public.

"The long anticipated release of the #JFKFiles will take place tomorrow," he promised Wednesday. "So interesting!"

Given Trump's enthusiasm, legions of assassination scholars, professionals and hobbyists had been waiting throughout the day to begin a reading frenzy. Any delay or limitations of the release could only be ordered by the president.

In his memo Thursday night, Trump said that any agency wanting to continue withholding documents after April 26 "should be extremely circumspect in recommending any further postponement of full disclosure of records."

Some of the material that assassination experts had been most eager to review was not included in the documents released Thursday. The missing records include a 338-page file on J. Walton Moore, the head of the CIA office in Dallas at the time of the killing, and an 18-page dossier on Gordon McClendon, a Dallas businessman who conferred with Ruby just before he shot Oswald. Several files on notorious anti-Castro Cuban exiles were apparently withheld, including those focusing on Luis Posada and Orlando Bosch, who had been accused of a 1976 airline bombing that killed 73 people.

Researchers had hoped the release would shed new light on Oswald's movements and contacts in the months before he shot Kennedy. Historians were particularly eager for new details of Oswald's six-day trip to Mexico City, where he met with Cubans and Soviets two months before the assassination.

None of those documents appeared to be in the batch released Thursday. Nor were there revelations on Watergate burglars E. Howard Hunt and James McCord, both of whom were longtime CIA operatives of interest to assassination theorists.

If the cache of material did not deal a blow to the Warren Commission's conclusion that Oswald acted as the lone gunman in Dealey Plaza, it did contain fascinating historical nuggets, big and small. Among them was a price list that Cuban exiles agreed they would pay to kill Cuba's revolutionary leaders: $100,000 for Fidel Castro and $20,000 each for Che Guevera and Raul Castro. A 1963 CIA cable from Mexico City describes Oswald visiting the Soviet embassy, where he insisted on speaking what was described as "terrible hardly recognizable Russian."

A long draft report by the House Select Committee on Assassinations concludes that the theory that Cuba ordered the killing in response to CIA attempts to kill Fidel Castro was unlikely.

"The Committee does not believe Castro would have assassinated President Kennedy, because such an act, if discovered, would have afforded the United States the excuse to destroy Cuba," the draft states.

The release of the documents was mandated by a 1992 act of Congress meant to finally clear the official cupboards of classified material that had been shrouded in controversy and hearsay for decades.

The President John F. Kennedy Assassination Records Act, signed by President George H.W. Bush on Oct. 26, 1992, required that "each assassination record shall be publicly disclosed in full . . . no later than the date that is 25 years after the date" of its enactment.

But there was an out: The president would have the right to withhold some records that, if revealed, would harm national security and outweigh "the public interest in disclosure." The law also requires the administration to publish an unclassified explanation for the postponement in the Federal Register.

David L. Boren, the former chairman of the Senate Intelligence Committee who co-sponsored the records release law, said in a statement Thursday to The Post: "It was my intention that all documents be released in unredacted form except for in the most rare, exceptional circumstances involving current and continuing national security concerns."

Trump had been lobbied to withhold some of the files by CIA Director Mike Pompeo, according to Trump confidant Roger Stone.

Stone, a political consultant who wrote a book alleging that Lyndon B. Johnson had Kennedy murdered, pushed Trump to release everything and hailed the president's decision as a victory on Twitter.

But in an interview Wednesday, Stone said he worried that the intelligence community might still persuade his friend not to release all the papers, or that the files might be heavily redacted. He cited a previous release of classified material that left researchers disappointed.

"If the data dump that the National Archives did in July of a small amount of JFK-related material is any indication, the fallback of the intelligence agencies appears to be redact and withhold as much of this information as possible," Stone said. "They'll use the broad rubric of national security. If the censorship is so great to make the president's order meaningless, it'll get litigated in the courts."

In a statement, the CIA said its redactions were meant to protect national security interests — the names of CIA assets and current and former CIA officers, intelligence-gathering methods and sensitive partnerships that remain viable today.

But the agency also vowed to release all of its Kennedy assassination records. "Every single one of the approximately 18,000 remaining CIA records in the collection will ultimately be released, with no document withheld in full," the statement said. Those CIA documents, come April, could still retain redactions. The statement said the redacted information in the 18,000 pages represents less than 1 percent of all CIA information in the collection.

Many of the documents were created in the 1990s, making some of the information more sensitive and recent than older documents from decades ago.

The National Archives has had custody of the records since the Warren Commission published its investigative findings in 1964.

In 1991, Oliver Stone released his movie, "JFK," which suggested that Kennedy was killed in a grand conspiracy involving the CIA, the FBI and the military. At the end of the film, audiences were informed that many of the investigative documents would not be released until 2029. Soon, protests erupted, and Congress passed the assassination records act that was signed into law a year later.

By the early 1990s, only a sliver of the Warren Commission's papers — just 2­ percent — had been concealed, either partially or in full, according to the National Archives. Since then, the archives has made periodic releases of its repository, which totals more than 5 million pages. In a recent article on its website, the archives said that 88 percent of its documents are fully open; 11 percent have been released but with redactions; and 1 percent has been fully withheld.

In early 2016, the website GovernmentAttic.org obtained through the Freedom of Information Act the list of what was then more than 3,600 records that had been entirely withheld. Titles of the documents included "Personality File on Lee Harvey Oswald" and "Tape of Mr. William K. Harvey's Interview, 4/10/75," a reference to the legendary CIA officer who oversaw the agency's plots to kill Fidel Castro.

A majority of Americans believe others besides Oswald were involved in the shooting, according to repeated Gallup polls conducted over the past 50 years. Since the Warren Commission concluded its investigation, historians and journalists have written extensively about how the CIA deliberately concealed information about Oswald's interactions with Cubans or Soviets in Mexico City before the killing.

Conspiracy theories have dogged the investigation in part because of the Warren Commission's marching orders. President Lyndon B. Johnson told the members of his handpicked investigative board that he wanted to squash the raging public fears that a foreign power or communist operatives had killed Kennedy. He told Supreme Court Chief Justice Earl Warren that the country was "confronted with threatening divisions and suspicions" and that it was the commission's "patriotic mission" to squelch "dangerous rumors."

Warren was a close and loyal ally of Kennedy's. He short-circuited some areas of investigation that could embarrass the president. He personally — and privately — interviewed former first lady Jackie Kennedy, a key witness, rather than allow his staff to pose their own questions.

Johnson himself had worried that a foreign power may have been involved, according to a 1969 interview with Walter Cronkite.

"I can't honestly say that I've ever been completely relieved of the fact that there might have been international connections," Johnson told the television newsman.

Johnson later asked that this portion of the interview be deleted from the public broadcast.

Philip Shenon, author of a 2013 book on the Warren Commission, interviewed one of the commission's chief investigators, David Slawson, for Politico two years ago and showed him documents that had been declassified in the 1990s but that Slawson had never seen. Slawson's conclusion: The CIA tampered with surveillance evidence of Oswald in Mexico City that would have revealed the agency knew of Oswald's threat well before the assassination.

Even the CIA publicly acknowledged in 2014 that ­John McCone, its director at the time of the assassination, participated in a "benign cover-up," according to a paper by agency historian David Robarge. His article said McCone was "complicit in keeping incendiary and diversionary issues off the commission's agenda."

The agency historian wrote that McCone purposely did not tell the commission about CIA-Mafia plots to kill Castro, some of which had been planned at the Mexico City station.

"Without this information," Shenon concluded in a 2015 Politico story, "the commission never even knew to ask the question of whether Oswald had accomplices in Cuba or elsewhere who wanted Kennedy dead in retaliation for the Castro plots."

During a White House conference call with reporters Thursday, CNN reporter Jim Acosta asked whether the documents would contain information on any role the father of Sen. Ted Cruz (R-Tex.) might have played in the assassination — a false charge Trump had raised during the 2016 presidential campaign.

"Honestly, we're not going to comment on the content of the files," a National Archives official replied.