President Trump said Friday that he’ll release “ALL” of the remaining John F. Kennedy files, after being forced by U.S. spy agencies – of which he has been leery – to withhold thousands of still potentially sensitive documents.

"After strict consultation with General Kelly, the CIA and other agencies, I will be releasing ALL JFK files other than the names and addresses of any mentioned person who is still living," Trump tweeted. "I am doing this for reasons of full disclosure, transparency and in order to put any and all conspiracy theories to rest."

The National Archives on Thursday released 2,800 once-classified records related to the 1963 assassination of President John F. Kennedy.

Behind the scenes of the much-anticipated release, Trump and his White House lawyers were purportedly until the last minute going back and forth with U.S. intelligence officials over their requests for additional redactions.

And the requests irritated Trump, who continued to resist signing off on the request, according to an account by two White House officials who spoke only on condition of anonymity.

Late last week, Trump received his first official briefing on the release in an Oval Office meeting that included Kelly, his chief of staff; White House Counsel Don McGahn and National Security Council legal adviser John Eisenberg.

Just before the documents’ release, Trump wrote in a memorandum that he had "no choice" but to agree to requests from the CIA and FBI to keep thousands of documents secret because of the possibility that releasing the information could still harm national security.

Two aides said Trump was upset by what he perceived to be overly broad secrecy requests, adding that the agencies had been explicitly warned about his expectation that redactions be kept to a minimum.

According to White House officials, Trump accepted that some of the records contained references to sensitive sources and methods used by the intelligence community and law enforcement and that declassification could harm American foreign policy interests.

But after having the scope of the redactions presented to him, Trump told aides he did not believe them to be in the spirit of the law.

On Thursday, Trump's top aides presented him with an alternative to simply acquiescing to the agency requests: He could temporarily allow the redactions while ordering the agencies to launch a new comprehensive examination of the records still withheld or redacted in part.

Trump accepted the suggestion, ordering that agencies be "extremely circumspect" about keeping the remaining documents secret at the end of the 180-day assessment.

The tale of the final hours before the congressionally mandated 25-year release deadline adds a new chapter to the story of Trump's troubled relationship with his spy agencies.

Between the time Trump was elected in November 2016 and took office in January, he slammed the CIA for concluding Russia hacked Democratic Party emails to help him win the White House over Democrat Hillary Clinton.

And Trump has been critical of how the FBI handled the investigation into then-Secretary of Clinton’s private email servers -- to the point of firing Director James Comey.

Since taking office, Trump also has moved to exert more control over U.S. spying agencies and accused his predecessor of using government spycraft to monitor his campaign. In the JFK files matter, one White House official said, Trump wanted to make clear he wouldn't be bullied by the agencies.

Under a 1992 law, all of the records related to the assassination were to be made public unless explicitly withheld by the president.

The Associated Press contributed to this report.