The Justice Department issued a legal opinion Friday finding that Treasury Secretary Steve Mnuchin was right to withhold President Donald Trump’s tax returns from a House committee that subpoenaed them.

The House Ways and Means Committee subpoenaed six years of Trump’s tax returns in May, but the Treasury Department refused to provide the documents. At the time, Mnuchin said the request lacked a “legitimate legislative purpose.”

The 33-page opinion from the Justice Department’s Office of Legal Counsel argues that the committee’s chairman, Rep. Richard Neal, D-Mass., wanted to make the president’s tax returns public and because of that plan, the request was not to carry out a legitimate legislative function.

In its opinion Friday, the DOJ’s Office of Legal Counsel said that it advised the Treasury Department to deny the request.

“While the Executive Branch should accord due deference and respect to congressional requests, Treasury was not obliged to accept the Committee’s stated purpose without question, and based on all the facts and circumstances, we agreed that the Committee lacked a legitimate legislative purpose for its request,” the opinion states.

But Neal has said the law is clear the information must be released to Congress, the documents were sought to aid a committee investigation into whether the IRS is doing its job properly to audit a sitting president, and obtaining them would be a “necessary piece” of the committee’s work.

“The Chairman’s request that Treasury turn over the President’s tax returns, for the apparent purpose of making them public, amounted to an unprecedented use of the Committee’s authority and raised a serious risk of abuse,” the opinion said.

Neal said last month that he didn’t plan to hold Mnuchin in contempt, saying the committee may instead pursue a legal fight to force the Treasury Department to turn over the documents.

A spokeswoman for the House Ways and Means Committee said the legal opinion was still being reviewed and declined to comment further. Representatives for the Treasury Department did not immediately respond to a request for comment.

The Justice Department’s backing of Treasury’s refusal to provide the president’s tax returns is likely to further tensions between congressional Democrats and Attorney General William Barr, whom they’ve accused of trying to stonewall Congress’ constitutional oversight power.

Sen. Ron Wyden, the top Democrat on the Senate Finance Committee, said the opinion “reads like it was written by Donald Trump’s personal lawyer” and said it “further reflects Attorney General Barr’s willingness to protect the president at all costs.”