Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The White House will keep most of its visitor logs secret, a senior administration official confirmed to NBC News Friday.

The decision comes after months of questions about the fate of the Obama-era precedent of releasing White House visitor logs and marks another stark contrast between the administrations. The Obama administration voluntarily disclosed more than 6 million records during his years in office.

The news was first reported by the Washington Post and Time.

The senior official, who spoke on condition of anonymity, expected criticism and questions about a lack of transparency but argued that White House officials need to be able to get policy input freely without individuals' names being released publicly.

President Donald Trump makes a surprise appearance on March 7 in front of the first group of White House visitors since his inauguration. A portrait of Hillary Clinton hangs at left. Erik S. Lesser / EPA

In a statement released by the White House, communications director Michael Dubke cited "the grave national security risks and privacy concerns of the hundreds of thousands of visitors annually" in their decision to keep the records shrouded.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The administration plans to use a prior federal court ruling that designates most of the logs as presidential records to defend the lack of disclosure.

“By instituting historic restrictions on lobbying to close the revolving door, expanding and elevating ethics within the White House Counsel’s office, and opening the White House Press Briefing Room to media outlets that otherwise cannot gain access, the Trump Administration has broken new ground in ensuring our government is both ethical and accessible to the American people," Dubke's statement continued.

While the Obama administration did release millions of records, it was not an exercise in unfiltered transparency — something Trump officials were quick to point out as "faux" transparency.

The Obama White House reserved the right to redact records of visitors that were personal guests not involved in official or political business, as well as records related to "particularly sensitive meetings," giving an impartial picture of who was coming and going on the 18-acre White House grounds.

Critics said the Trump administration's move is the White House's attempt "to avoid public accountability."

“Elected officials work for the people and we deserve to see government business conducted in transparent daylight," ACLU political director Faiz Shakir said in a statement. "This ‘Good Friday’ news dump is simply the latest in a series of efforts by President Trump to avoid public accountability, and it’s not the way to improve the people’s declining trust in this administration."

Earlier this week, a group of watchdog organizations sued the Trump administration in federal court to get the White House to release the same types of records the Obama administration made public on its website.

Those seeking the logs under the Trump administration must file Freedom of Information Act requests.

The White House previously told NBC News it could not answer whether the administration would publicly disclose the names of individuals who visit Mar-a-Lago, which the President has called “the Southern White House”.

Along with the policy reversal comes the end of the open WhiteHouse.gov website, which the administration calls duplicative of other federal government information sites. By closing the site, the White House estimates it will save over $70,000 in taxpayer dollars by 2020.

The decision comes as President Donald Trump is out of Washington at his Mar-a-Lago club for the seventh weekend since taking office.