After the conviction last year of President Trump’s former lawyer and fixer Michael Cohen, federal prosecutors shut down their investigation into hush-money payments made before the 2016 presidential election. But the inquiry didn’t end there.

Cyrus R. Vance Jr., Manhattan’s district attorney, stepped in, following the office’s long tradition of aggressively pursuing fraud and white-collar crime. As part of that continued investigation, Vance is now seeking Trump’s tax returns — putting the local prosecutor, who has previously tangled with the Trump family, at the forefront of efforts to scrutinize the president’s financial dealings.

Trump’s lawsuit seeking to stop Vance’s subpoena for eight years of the president’s tax returns will be heard Wednesday in the U.S. Court of Appeals for the 2nd Circuit. The fast-moving case comes amid an impeachment inquiry over allegations of abuse of power by the president and could reach the Supreme Court this term. Trump is fighting similar attempts by congressional Democrats to obtain his tax records.

Vance’s role as the elected district attorney in Trump’s hometown puts him in a unique position. His office enforces state laws and is not bound by Justice Department guidelines that prevent federal prosecutors from charging a sitting president with a crime.

“Just because the feds have made the decision not to pursue a case against the president, that doesn’t in any way change the fact that the state has a valid interest in enforcing its laws — and a right here to do so,” said Anne Milgram, a former federal prosecutor who also served as New Jersey’s attorney general.

Vance, a reserved lawyer from a prominent Democratic family, was elected to his post in 2009. He declined to be interviewed for this article, but he previously said he views the office as a sometimes partner — or backstop — to federal law enforcement.

“We have to be able to fill the gaps when the FBI can’t or won’t take these cases,” including terrorism and terrorism finance cases, Vance said in an interview last spring.

Weeks after federal prosecutors concluded their campaign finance investigation without filing additional charges, Vance’s office began examining whether any Trump Organization officials had filed falsified business records, in violation of state law, regarding the 2016 payments to two women who said they had had affairs with Trump years earlier.

Trump sued Vance in federal court to try to block the subpoena to his longtime accounting firm, Mazars USA, claiming he cannot be investigated by any prosecutor, for any reason, as long as he is in the White House.

Trump singled out Vance on Twitter this month after a federal judge in New York rejected the president’s sweeping immunity claim as “repugnant” to the Constitution.

Democrats “have failed on all fronts, so now they are pushing local New York City and State Democratic prosecutors to go get President Trump,” the president tweeted. “A thing like this has never happened to any President before. Not even close!”

Trump has denied the affairs and any wrongdoing in connection with the hush-money payments arranged by Cohen.

Lawyer William S. Consovoy, who will argue the president’s appeal Wednesday, declined to comment. In court filings, Trump’s legal team says it is unprecedented for a local prosecutor to investigate the business of a sitting president.

“There are many reasons why a local elected official would target the most prominent official from the other political party — to curry favor with constituents, to make a name for himself, to help his fellow partisans in Washington,” the lawyers wrote in court filings last week.

“Even now, the District Attorney cannot refrain from taking political potshots at the President, or from framing his criminal investigation as part of a broader narrative about ‘impeachment.’ ”

But former state and federal prosecutors say Vance is treading the path of his predecessor, the legendary district attorney Robert M. Morgenthau, who for decades used New York state laws to take on significant, high-profile investigations of corrupt politicians, corporate titans and banks from an office that has long played an outsize law enforcement role.

Vance “takes pains to be fair-minded,” said lawyer Paul Shechtman, a former federal prosecutor who was counsel to Morgenthau. “But he’s not afraid of going to battle.”

Last spring, after former Trump campaign chairman Paul Manafort was convicted in federal court, he was indicted by Vance’s office on state mortgage fraud charges. The step was widely viewed as something of an insurance policy in case the president pardons Manafort on the federal conviction. Manafort has pleaded not guilty to the state charges.

The office’s inquiry into the president’s family business is a major test for Vance, who has faced criticism for his investigations of influential people, including Hollywood mogul Harvey Weinstein and two of Trump’s children.

Vance, 65, was exposed early to powerful players in Washington. His father, for whom Vance was named, served as secretary of state in the Carter administration and secretary of the Army in the Kennedy administration. As a child, the younger Vance spent the night at the White House, where President Lyndon B. Johnson gave him a pen knife.

During his nine-year tenure as district attorney, his office has handled cases against nearly a dozen foreign banks that violated federal sanctions laws by falsifying business records. Those convictions, which came in parallel with federal convictions, resulted in about $3 billion in fines and forfeitures. Vance’s office used some of the money for testing rape kits to reduce the backlog of investigations across the country.

Despite his Democratic pedigree, Vance has received campaign contributions from major Republican donors and was endorsed by the conservative New York Post editorial board in 2009. He has frustrated privacy advocates on one of his signature issues, encryption, as he has highlighted the difficulties investigators face in gaining access to devices.

On that issue, “Cy Vance has been completely aligned with law-and-order Republicans who have wanted to see back doors built into encryption,” said Chris Calabrese, vice president for policy at the Center for Democracy and Technology.

Vance also was criticized for how he handled an investigation involving Ivanka Trump and Donald Trump Jr. After a two-year probe, Vance decided in 2012 not to prosecute the two for allegedly misleading potential buyers for the Trump SoHo condo and hotel development.

“I felt we should keep digging and looking at it because there was enough there, but that was his call,” said Adam S. Kaufmann, the office’s former head of investigations, adding that he respected Vance’s decision.

“At the time, he felt if you were going to go after Trump, this larger-than-life New York figure, you’re going to have to have the goods.”

Trump’s attorney, Marc Kasowitz, met personally with Vance before the decision was announced. Kasowitz had donated to Vance’s reelection campaign, money that the prosecutor returned before the meeting, ProPublica and WNYC first reported.

Vance defended his decision, saying it was driven by diminished prospects for a conviction in part because the victims in the case were not cooperating.

“We looked at it hard,” Vance said last spring. “There was a lot of criticism, but I don’t sell cases, and I’m not going to take cases that I think are ones we can’t win.”

He also drew flak for not charging Weinstein in 2015, when the movie producer was accused of groping model Ambra Battilana Gutierrez. Subsequent revelations about Weinstein’s long pattern of sexual assault and harassment helped spark the #MeToo movement.

Again, Vance said, the head of the office’s sex crimes unit advised him that this was not a case they could win. Vance is currently prosecuting Weinstein on sexual assault charges based on allegations by women who came forward in late 2017 and early 2018.

In the hush-money investigation, Vance has said that, at this stage, Trump “has not been identified as a defendant, nor is there an assumption he will be.”

In his plea agreement with federal prosecutors, Cohen said he arranged the payment to Stormy Daniels — and another to Playboy model Karen McDougal — to keep their allegations of affairs with Trump from becoming public before the election.

Cohen implicated unidentified Trump Organization executives and said the payments were directed by Trump — and reimbursed by Trump.