(Reuters) - U.S. President Donald Trump’s former lawyer Michael Cohen testified on Tuesday that “at the direction of” the president, he arranged six-figure hush payments ahead of the 2016 presidential election to adult-film actress Stormy Daniels and former Playboy model Karen McDougal.

U.S. President Donald Trump speaks at a Make America Great Again rally at the Civic Center in Charleston, West Virginia, U.S., August 21, 2018. REUTERS/Leah Millis

Both women have said they had affairs with Trump, which he has denied.

Cohen gave his testimony in a New York courtroom as part of a deal with prosecutors in which he pleaded guilty to campaign finance violations, tax evasion and bank fraud.

Trump said on Twitter on Wednesday that the campaign finance violations to which Cohen pleaded guilty were “not a crime,” even though prosecutors and Cohen agreed that they were. Trump made the claim without offering any evidence.

His lawyer, Rudy Giuliani, has said the payments were personal in nature and unrelated to the campaign.

The following explains the protections from criminal prosecution that are afforded a U.S. president and how impeachment could be used to remove Trump from office.

Can the president be charged with a crime while in office?

The U.S. Constitution does not address this. A number of legal experts have said that a president cannot be indicted while in office, and that if a president committed a crime the appropriate recourse would be impeachment. The U.S. Constitution specifies that the president can be impeached for treason, bribery or other “high crimes and misdemeanors.”

The U.S. Supreme Court has not ruled on whether a sitting president can be charged with a crime, but in a 2000 memorandum the Department of Justice concluded that criminal proceedings would impermissibly interfere with the president’s ability to carry out his job.

Other experts have said that a sitting president can be indicted, arguing that no person is above the law.

How does the impeachment process work?

The impeachment process starts in the House of Representatives. Individual members can introduce impeachment resolutions like ordinary bills, or the House can initiate proceedings by passing a resolution authorizing an inquiry.

Impeachment requires a simple majority to pass the House, but removal of the president from office further requires a two-thirds majority in the Senate.

Two American presidents have been impeached: Andrew Johnson in 1868 and Bill Clinton in 1998. In both cases, a majority of the Senate did not approve removal and they remained in office.

If a president is impeached and removed, the vice president takes over until the next scheduled presidential election.

Is a violation of campaign finance law an impeachable offense?

Legal experts disagree over whether Trump could be impeached based on the allegation that he directed Cohen to make an unlawful campaign contribution.

Congress has latitude to determine “high crimes and misdemeanors.” While it has looked to U.S. criminal code for guidance, it is not bound by it, legal experts said.

Andrew Wright, a former associate counsel to former President Barack Obama, said the Cohen guilty plea was sufficient grounds to begin an impeachment investigation.

He said the constitution suggests that the country’s founders were concerned about potential abuses of power, which would include an effort to mislead the public in the run-up to an election.

Other experts have said that Trump could argue that the payments to the women were not a crime because they were made to protect Trump’s reputation, not for the purpose of influencing the election.

Even if the payments were intended to influence the election, some legal scholars have argued that campaign finance violations are typically enforced through civil penalties and do not amount to a high crime or misdemeanor. Therefore, impeachment would not be warranted.