A federal judge in California Thursday granted the Trump campaign’s request to block a new law that requires presidential and gubernatorial candidates to release five years of tax returns to run in the state’s primary elections.

The law signed by Gov. Gavin Newsom, a Democrat, in July would have left the sitting president off of the ballot in California’s March 2020 primary unless he submitted five years’ worth of his tax returns by a Nov. 26 deadline, the Los Angeles Times reported. Under SB 27, Trump would be included on the general election ballot in November 2020. Oppoenents of the law argue depressed GOP voter turnout in the primary could discourage voters from showing up to vote for the president in the main race.

TRUMP FILES LAWSUIT IN BID TO PROTECT PERSONAL, CORPORATE TAX RETURNS FROM RELEASE

“We are encouraged that the federal court has tentatively concluded that a preliminary injunction should be granted. We look forward to the court’s written order," Trump's attorney, Jay Sukelow, said in a statement, according to The Hill. "It remains our position that the law is unconstitutional because states are not permitted to add additional requirements for candidates for president, and that the law violated citizens’ 1st Amendment right of association."

U.S. District Judge Morrison England Jr., who was appointed by President George W. Bush, said he would issue a final ruling by the end of the month. He said he handed down an initial order from the bench to prevent the “irreparable harm without temporary relief” for Trump and other candidates should the law go into effect, according to the Times.

Thursday’s hearing consolidated five separate lawsuits filed against the state in response to SB 27. But Trump was the most high-profile defendant. Some argue the law was politically motivated and was conjured up by Democrats who are leading a widespread push to force the president to turn over his tax returns.

"The elephant in the room is President Trump's tax returns — that's what this is about," England said during the hearing in Sacramento. "But it does have implications that are far-reaching."

Trump's lawyers said SB 27 would unfairly force the president to give up his right to privacy. Trump has already complied with federal law by submitting an annual report that provides an overview of his finances. The Ethics in Government Act (EIGA), which was enacted in 1976, applies to a range of high-ranking federal officials, the Los Angeles Times reported.

Lawyers from the state and national Republican parties also argued that the U.S. Constitution, not states, sets the qualifications to run for president and that a federal law requiring candidates to release financial information supersedes the state's power to seek additional details.

"I don't care how you skin the cat, it's an unconstitutional law," Harmeet Dhillon, who represented the state and national Republican parties, said during the hearing. Lawyers also argued the law sets a dangerous precedent and could lead to candidates being forced to release medical records or college transcripts in order to be able to qualify to run for office.

The state's attorneys said it's within California's power to regulate its primary elections.

Secretary of State Alex Padilla said the state will consider whether or not to appeal the ruling when the judge releases a written decision by Oct. 1.

None of the Democratic 2020 presidential candidates have submitted five years’ worth of their tax returns to the state of California to comply with the new law, according to the Times. Some candidates have released at least some portion. Newsom, who signed SB 27 into law, allowed reporters in 2017 to sift through five years’ worth of his own tax records, according to the Times.

Under California’s so-called jungle primary system, all candidates, regardless of party, vie for the same elected office and the top two vote-getters move on to the general election. Since it was implemented in California in 2010, this system has often ensured a Democrat-on-Democrat general election battle in all but California’s most conservative areas. Depressed GOP turnout in primaries could mean even fewer Republicans move on to general elections.

CLICK HERE TO GET THE FOX NEWS APP

The ruling came hours after the president filed a lawsuit against his own accounting firm, Mazars USA, and Manhattan District Attorney Cyrus Vance in federal court on Thursday in an effort to prevent the release of his tax returns. In New York, the president sued in response to Vance’s move to subpoena Mazars for eight years of the president’s personal and corporate tax returns as part of a criminal investigation into potential campaign finance violations.

Democratic-led congressional committees also are trying to obtain Trump's tax returns and other records that could provide a window into his finances. Trump and three of his children sued in April seeking to block two House committees from getting records that his longtime lender, Deutsche Bank, has said include tax returns.

Fox News’ Andrew O’Reilly and The Associated Press contributed to this report.