US President Donald Trump has come under fire for deleting tweets in support of a Senate candidate that went on to lose.

Some experts are saying it's against the law.

We take a look at whether Mr Trump's actions could actually land him in trouble.

How did this debate begin?

Mr Trump openly backed former Alabama state attorney-general Luther Strange to win the Republican primary for the state of Alabama.

His tweets touted support for Mr Strange, who had filled the vacancy since Jeff Sessions was promoted to the role of Mr Trump's Attorney-General.

But Mr Strange lost.

Loading

Also lost were Mr Trump's tweets of support for Strange.

But it wasn't long before people starting trawling the internet to look for the tweets Mr Trump had wiped from his account.

Loading

Loading

So, is he allowed to delete tweets?

In the normal world, deleting posts on social media is pretty common.

But if you're the president of the United States, you technically fall under a law called the Presidential Records Act [PRA].

It was created by Congress in 1978 over concerns that former president Richard Nixon would destroy the tapes that led to his resignation.

The law stipulates that materials can include "books, correspondence, memoranda, documents, papers, pamphlets, works of art, models, pictures, photographs, plats, maps, films, and motion pictures, including, but not limited to, audio and visual records, or other electronic or mechanical recordations, whether in analog, digital, or any other form".

The rules were obviously created before social media existed.

But an update to the definition by former president Barack Obama made sure "digital" material, including email, Facebook, Twitter and YouTube, was covered.

And "presidential records" are defined as those "created or received by the president, the president's immediate staff, or a unit or individual of the executive office of the president whose function is to advise or assist the president".

That means even if a staffer wrote or sent it, it's still classified as "presidential records".

The law also means that any tweets sent by the president are owned by the United States.

If a president wants to dispose of presidential records, he or she has to prove it has no "administrative, historical, informational, or evidentiary value".

They also need to obtain the views, in writing, of the archivist concerning the proposed disposal of such presidential records.

And the archivist has to state that they do not intend to take any action.

If they don't have a problem with the material being deleted, the president can dispose of presidential records if copies of the disposal schedule are "submitted to the appropriate Congressional Committees at least 60 calendar days of continuous session of Congress in advance of the proposed disposal date".

Which means you have to give at least two months' notice.

What could be the consequences?

Earlier this year in a piece for The Conversation, Shontavia Johnson, a professor of intellectual property law at Drake University, said there wasn't a law that could stop him from doing it.

"If a tweet is the catalyst for a lost ally, new policy or other reaction, American history deserves to have a record of it," Professor Johnson said.

"In the instance of Trump's deleted and altered tweets, it makes sense to require they be archived and preserved.

"But if Trump decides to dispose of them without taking such steps, there doesn't seem to be a federal law to stop him.

"To create a full digital picture of Trump's presidency, we may have to rely on the screenshots from private citizens or others."

While there are several screenshots of Mr Trump's deleted tweets, it's unknown whether any action will actually be taken against him.

"Courts can review whether any given piece of information should be categorised as a presidential record or not," Professor Johnson said.

"But, the president has control over 'creation, management, and disposal' decisions after that initial categorisation, assuming he or she has permission of the archivist.

"This cannot be reviewed by a court.

"And the PRA does not give the archivist or Congress veto power over a president's record-keeping decisions.

"In this way, the law creates a system that cannot be checked once the president makes a decision to create, manage or delete a given record."

Senior lecturer in American politics and foreign policy at the United States Studies Centre David Smith said Mr Trump's tweets were already part of the permanent internet record.

"My personal view is it's not that much of an issue … any of the President's tweets are going to be [public] whether he deletes them or not," Dr Smith said.

"There a separate account that sort of puts all his tweets into the format of presidential statements … when you go on Twitter there is no possibility that he can actually remove things from public memory."

And he said he didn't expect it to end up in court.

"Having said that I don't know about the legality of it if he actually destroys something he has written," Dr Smith said.

"In the current social media environment where a Trump tweet can drive news cycles, there's no possibility that Trump can actually erase that record.

"I very much doubt that any legal action would be taken against the President."