Donald Trump's attempt to block being forced to reveal eight years of personal and corporate tax records has been dismissed by a judge.
The US president has been fighting efforts to obtain the documents, which shed light on his financial dealings, dating back to 2011.
He was forced to publish them by a grand jury subpoena and then tried to bring legal action to quash the ruling.
But on Thursday, a US district judge, Victor Marrero, said granting the relief would be an "undue expansion" of presidential immunity.
Following the ruling, the president filed an emergency appeal to delay the enforcement of the subpoena.
The probe into Mr Trump's tax affairs relates to an investigation by district attorney Cyrus Vance in New York.
Mr Vance said in court documents last month the probe was into "alleged insurance and bank fraud by the Trump Organisation and its officers".
Mr Trump, who is fighting for reelection against Democratic presidential nominee Joe Biden, has defied decades of precedent set by previous by candidates by refusing to release his tax returns.
His lawyers argued the subpoena against him was issued in bad faith, might have been politically motivated, and amounted to harassment.
They claimed that it was issued in retaliation for the Trump Organisation declining to provide records ranging from June 2015 to September 2018.
That is the same time span covering an investigation into payoffs to two women, including porn actress Stormy Daniels, to keep them quiet during the 2016 presidential campaign about alleged extramarital affairs with Mr Trump.
Mr Trump has denied the affairs.
Mr Vance's legal team said they were entitled to the tax records to help with a "complex financial investigation", citing reports of "extensive and protracted criminal conduct at the Trump Organisation".
Thursday's ruling came shortly after it emerged that Mr Trump's former chief strategist Steve Bannon had been arrested and charged with conspiracy to commit wire fraud.