The Obama administration granted less than a quarter of public requests for government files in its last year in office and spent $36.2 million on legal battles to keep its files secret, according to a new transparency report compiled for “Sunshine Week.”

Having aspired to be “the most transparent administration in history” at the beginning of President Barack Obama’s first term, it instead set records for denying, delaying or obstructing requests for government records under the Freedom of Information Act (FOIA), the Associated Press reported on Tuesday, citing analysis of data provided by the US government.

The Justice Department spent $12 million on legal costs in fighting to keep its files from the public, with the Department of Homeland Security spending $6.3 million and the Department of Defense spending $4.8 million, AP noted. The three departments received more than half of the total FOIA requests made in 2016.

Obama's final year: US spent $36 million in records lawsuits The Non-Transparent Administration https://t.co/wBYrUBgFp7 — John Fund (@johnfund) March 14, 2017

The Obama administration set many FOIA records last year, from the number of requests received (788,769) to the amount spent on answering them ($478 million). There were 4,263 full-time FOIA employees across over 100 federal agencies, 142 people more than in 2015.

Other achievements were less flattering, however – such as breaking its own record from 2015 in telling citizens, journalists and others who made FOIA requests that they couldn’t find a single page of the requested files, AP reported without citing the number of such cases.

The previous administration also set records for denying access to files, refusing to quickly process requests described as particularly newsworthy, and denying requests for waivers of copy and research fees.

In 77 percent of the cases, people who asked for records in 2016 received partly or fully redacted files, compared to 65 percent in 2009.

The acknowledgement letters to all the #FOIA requests I filed in 2016. pic.twitter.com/b8qBdzAqZF — Jason Leopold (@JasonLeopold) December 31, 2016

AP’s revelations come during “Sunshine Week,” an event organized in March each year by the American Society of News Editors to educate the public on the importance of open government.

Under the 1966 Freedom of Information Act, individuals can request copies of federal records for free or at a nominal cost. The government is obligated to hand them over, unless the disclosure could harm national security, violate personal privacy, or expose confidential decision-making – exemptions that authorities often abuse, according to critics.

“I will hold myself as president to a new standard of openness,” Obama said upon assuming office in 2009. “Transparency and the rule of law will be the touchstones of this presidency.”

During the 2015 Sunshine Week, the White House exempted itself from the FOIA.