A Washington federal judge had pointed questions for Donald Trump's attorneys Tuesday, as he mulled whether the president's longtime accounting firm must turn over eight years of financial records in response to a U.S. House Oversight Committee subpoena.

The hearing before U.S. District Judge Amit Mehta of the District of Columbia marks the first major courtroom test in the continued standoff between the president and Democratic lawmakers after the Trump administration resisted a spate of oversight demands from Congress.

Trump's attorney, William Consovoy, argued the subpoena at the center of the case, issued last month by House Oversight chairman Rep. Elijah Cummings, is unlawful because it was not tied to a legislative purpose. Consovoy said Tuesday the congressional investigation instead veered into what was essentially a law enforcement function.

But Mehta appeared skeptical of Consovoy's argument at times, and spent the early part of the hearing grilling the lawyer on some of the reasons Congress has cited as a basis for seeking Trump's past financial statements, including determining whether Trump has violated federal ethics laws or the constitution's emoluments clauses.

At one point, Mehta even asked Consovoy whether he believed congressional investigations related to Whitewater and Watergate were valid. Consovoy didn't directly answer the question, noting he would have to look at those examples more carefully.

Mehta asked Consovoy if he was “at the end of the day” asking the court to get behind “facially acceptable purposes” for congressional demands to look into Congress' motives. Mehta suggested courts can't do that so long as Congress asserts a facially plausible and legislative basis. “That's really the end of the court's inquiry, right?” Mehta asked.

Consovoy replied that he wasn't asking the court to look into Congress' “secret motives,” but to consider lawmakers' statements and letters related to the probe. Doing so, he argued, would make clear that Congress' goal was finding examples of wrongdoing by Trump, rather than advancing any legislation.

U.S. House lawyer Douglas Letter argued that courts have long recognized Congress' broad investigative authority. He also fielded tough questioning from Mehta, who asked whether there are limits to the scope of what Congress is able to investigate when it comes to the president.

The judge noted “there are no ordinary lines here” that the court could look to to test the validity of House Oversight's actions.

“We have an obviously legitimate purpose,” Letter said Tuesday. He agreed there were some limits, noting it would be a stretch to, for example, probe the president's “totally personal life” or subpoena a diary he had when he was 12 years old.

Mehta also asked Letter about the relevance of investigating potentially illegal conduct from Trump before he took office. Letter replied that Trump had ongoing financial activities and business relationships. Congress must know whether the president has potential conflicts of interest and whether foreign governments could potentially exercise control over him because they knew he was in violation of the law, Letter said.

Mazars, represented by the law firm Blank Rome, is not taking a legal position in the case.

Read more: