Although Trump hasn't been charged with any crimes, the question of whether a president can even be prosecuted while in office is a matter of legal dispute.

WASHINGTON — For the first time, prosecutors have tied President Donald Trump to a federal crime, accusing him of directing illegal hush-money payments to women during his presidential campaign in 2016.

The Justice Department stopped short of accusing Trump of directly committing a crime. Instead, they said in a court filing Friday night that Trump told his former personal lawyer, Michael Cohen, to make illegal payments to buy the silence of two women — porn actress Stormy Daniels and former Playboy model Karen McDougal — who claimed to have had affairs with Trump and threatened his White House bid. Trump has denied having an affair.

Cohen has pleaded guilty to several charges, including campaign finance violations, and is awaiting sentencing.

Although Trump hasn't been charged with any crimes, the question of whether a president can even be prosecuted while in office is a matter of legal dispute.

Here's a look at a that long-running legal ambiguity and a few of the main issues at play:

Did the president commit a crime?

That isn't completely clear. But federal prosecutors didn't accuse Trump in Friday night's court filing of violating the law.

However, there was no ambiguity in the court documents that prosecutors believe Cohen's actions were criminal and Trump was directly involved. Prosecutors charged that Cohen arranged the secret payments at the height of the 2016 campaign "in coordination with and at the direction of" Trump. They also alleged Cohen made the payment in order to fend off potential damage to Trump's presidential bid.

Federal law requires that any payments that are made "for the purpose of influencing" an election must be reported in campaign finance disclosures.

"There is a plausible case against the president," said Rick Hasen, a professor who specializes in election and campaign finance law at the University of California at Irvine.

In order to bring charges, prosecutors would have to prove Trump had criminal intent and "willfully violated the law," said Josh Blackman, a professor at South Texas College of Law Houston. Something that would be perfectly legal to do as a businessman could take on a different standard as a candidate and campaign finance laws are "very open-ended," he said.

Hasen said Trump's lawyers could argue Trump didn't have willfulness to break the law if the payments were completely personal and not connected to the campaign, despite their timing. Some legal experts have also argued that hush-money payments to keep people silent about their affairs are inherently personal, though Hasen said he didn't agree with that argument.

Can a sitting president be indicted?

Legal experts are divided on that question. The Supreme Court has never ruled on whether the president can be indicted or whether the president can be subpoenaed for testimony.

The Justice Department's Office of Legal Counsel, which provides legal advice and guidance to executive branch agencies, has maintained that a sitting president cannot be indicted. Two Justice Department reports, one in 1973 and one in 2000, came to the same conclusion.

Those reports essentially concluded that the president's responsibilities are so important that an indictment would pose too many risks for the government to function properly.

Trump's lawyers have said that special counsel Robert Mueller plans to adhere to that guidance, though Mueller's office has never independently confirmed that. Trump's personal attorney, Rudy Giuliani, has also said that a president cannot be indicted.

Could Trump be indicted one he leaves office?

There would presumably be no bar against charging a president after he leaves the White House.

Legal scholars have said that based on the Justice Department's guidance, it would appear that Trump could be charged for wrongdoing during the campaign or as president once he leaves office, but likely not before that.

Blackman said the statute of limitations for a campaign finance law violation — like the one Cohen pleaded guilty to — would be five years. The payments to Daniels and McDougal were made in 2016, meaning the statute of limitations would run out in 2021.

Could Trump pardon himself?

Trump has already shown he's not afraid to use his pardon power, particularly for those he has viewed as unfair victims of partisanship. He's pardoned Joe Arpaio, the former Arizona sheriff who was convicted of criminal contempt for disobeying a judge's order, and I. Lewis "Scooter" Libby, a Bush administration official convicted of perjury and obstruction of justice in a leak case.

Courts have never had to answer the question of whether the president can pardon himself. In June, Giuliani told NBC's "Meet the Pres" that while Trump "probably does" have the power, "pardoning himself would be unthinkable and probably lead to immediate impeachment."