STORY: Donald Trump had been set to be sentenced next week for illegally concealing hush-money payments to an adult film star.

But that was before the U.S. Supreme Court on Monday ruled that former presidents enjoyed immunity from criminal prosecution for official acts taken while in office.

And a New York judge on Tuesday agreed to delay Trump's sentencing until Sept. 18.

The change comes after Trump's attorneys argued the Supreme Court's decision means the first former president to be criminally convicted should have his conviction overturned.

Prosecutors with Manhattan District Attorney Alvin Bragg's office said earlier on Tuesday that Trump's argument was "without merit," but agreed to delay the sentencing to give Trump the chance to make his case.

In a written ruling, New York Justice Juan Merchan said he would rule on Trump's request by Sept. 6, with sentencing to follow less than two weeks later should the judge decide to uphold the conviction.

Trump's lawyers must submit their arguments by July 10, and prosecutors face a July 24 deadline to respond.

A New York jury found Trump guilty on 34 counts relating to the illegal concealment of payments to Stormy Daniels in an effort to buy her silence about what she says was a sexual affair with the former reality TV star.

Trump pleaded not guilty and denies the affair.

The sentencing had previously been set for July 11, just days before the Republican National Convention begins in Milwaukee.

The new timeline means Trump will likely have been nominated by his party to challenge Democratic President Joe Biden by the time he is sentenced.

Justice Juan Merchan will now decide Trump's punishment, including whether to jail him, in the thick of the general election campaign ahead of the Nov. 5 election.

Trump faces an uphill battle getting the hush money conviction overturned, since much of the conduct at issue in the case predated his time in office.