Donald Trump has attacked a Republican 2020 rival over an extramarital affair during an early morning Twitter rant in which he also promoted a QAnon conspiracy theorist.

"When the former Governor of the Great State of South Carolina, @MarkSanford, was reported missing, only to then say he was away hiking on the Appalachian Trail, then was found in Argentina with his Flaming Dancer friend, it sounded like his political career was over," Mr Trump tweeted on Monday.

"It was but then he ran for Congress and won, only to lose his re-elect after I Tweeted my endorsement, on Election Day, for his opponent. But now take heart, he is back, and running for President of the United States. The Three Stooges, all badly failed candidates, will give it a go!"

Mark Sandford, who announced on Sunday he would run against Mr Trump in the Republican primaries, was at the centre of a scandal when as governor of South Carolina he went missing for a week in the summer of 2009.

Before his disappearance, he told staff he would be hiking the Appalachian Trail, but later admitted to an affair with an Argentinian journalist after he was caught arriving back in the US on a flight from Buenos Aires.

Trump protests: President visits Texas and Ohio after mass shootings Show all 31 1 /31 Trump protests: President visits Texas and Ohio after mass shootings Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators chant as they protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District AP Trump protests: President visits Texas and Ohio after mass shootings El Paso Trump headed to El Paso, after visiting Dayton, Ohio to offer a message of healing and unity, but he was met by hostility in both places by people who fault his own incendiary words as a contributing cause to the mass shootings AP Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre US President Donald Trump greets first responders as he visits El Paso Regional Communications Centre AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre An anti-Trump protestor holds a sign as police are lined up outside University Medical Centre Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso Demonstrators hold a sign as the motorcade carrying President Donald Trump departs a joint operations center after meeting with first responders after the El Paso mass shooting, Wednesday, Aug. 7, 2019, in El Paso, Texas. (AP Photo/Evan Vucci) Evan Vucci AP Trump protests: President visits Texas and Ohio after mass shootings El Paso Anti-Trump protesters hold a banner outside the makeshift memorial to the victims of the WalMart shooting that left a total of 22 people dead, in El Paso, Texas, on August 7, 2019. - President Donald Trump consoled victims of a mass shooting in Ohio on Wednesday but protesters and opponents denounced what they say is his extremist rhetoric on race and immigration. The president's trip to Dayton, where nine people were gunned down over the weekend, was to be followed immediately after by a stop in the border city of El Paso, Texas, where 22 were murdered. (Photo by Mark RALSTON / AFP)MARK RALSTON/AFP/Getty Images MARK RALSTON AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators gather to protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District early Sunday morning, Wednesday, Aug. 7, 2019, in Dayton. Twenty-four-year-old Connor Betts opened fire in Dayton early Sunday, killing several people including his sister, before officers fatally shot him. (AP Photo/John Minchillo) John Minchillo AP Trump protests: President visits Texas and Ohio after mass shootings El Paso Democratic presidential candidate Beto ORourke hugs a woman at a makeshift memorial outside Walmart honoring victims of the mass shooting there which left 22 people dead. Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso Anti-Trump protesters hold signs outside the makeshift memorial to the victims of the WalMart shooting that left a total of 22 people dead, in El Paso, Texas, on August 7, 2019. - President Donald Trump consoled victims of a mass shooting in Ohio on Wednesday but protesters and opponents denounced what they say is his extremist rhetoric on race and immigration. The president's trip to Dayton, where nine people were gunned down over the weekend, was to be followed immediately after by a stop in the border city of El Paso, Texas, where 22 were murdered. (Photo by Mark RALSTON / AFP)MARK RALSTON/AFP/Getty Images MARK RALSTON AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso Marisela Hernandez holds sign to protest the visit of President Donald Trump to the border city after the Aug. 3 mass shooting in El Paso, Texas, Wednesday, Aug. 7, 2019. Aiming to play the traditional role of healer during national tragedy, President Donald Trump paid visits Wednesday to cities reeling from the mass shootings. (AP Photo/Andres Leighton) Andres Leighton AP Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre An anti-Trump demonstrator holds up a placard outside the University Medical Center, where U.S. President Donald Trump holds a meeting with first responders in the wake of last weekend's mass shootings at a Walmart store, in El Paso, Texas, U.S., August 7, 2019. REUTERS/Jose Luis Gonzalez JOSE LUIS GONZALEZ Reuters Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre President Trump and First Lady Melania Trump greet PFC Glendon Oakley (second right), who saved several lives during the mass shooting in Texas AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators chant as they protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District early Sunday morning, Wednesday, Aug. 7, 2019, in Dayton. (AP Photo/John Minchillo) John Minchillo AP Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre An anti-Trump demonstrator holds up a placard as police block the area outside the University Medical Center, where U.S. President Donald Trump holds a meeting with first responders in the wake of last weekend's mass shootings at a Walmart store, in El Paso, Texas, U.S., August 7, 2019. REUTERS/Jose Luis Gonzalez JOSE LUIS GONZALEZ Reuters/Amanda Voisard Trump protests: President visits Texas and Ohio after mass shootings El Paso Beto ORourke consoles a man at the makeshift memorial outside Walmart Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso, University Medical Centre An anti-Trump demonstrator yells near police outside the University Medical Centre Reuters Trump protests: President visits Texas and Ohio after mass shootings El Paso TOPSHOT - El Paso residents protest against the visit of US President Donald Trump to the city after the Walmart shooting that left a total of 22 people dead, in El Paso, Texas, on August 7, 2019. - President Donald Trump consoled victims of a mass shooting in Ohio on Wednesday but protesters and opponents denounced what they say is his extremist rhetoric on race and immigration. The president's trip to Dayton, where nine people were gunned down over the weekend, was to be followed immediately after by a stop in the border city of El Paso, Texas, where 22 were murdered. (Photo by Mark RALSTON / AFP)MARK RALSTON/AFP/Getty Images MARK RALSTON AFP/Getty Images Trump protests: President visits Texas and Ohio after mass shootings Dayton President Donald Trump and First Lady Melania Trump arrive at Wright-Patterson Air Force Base AP Trump protests: President visits Texas and Ohio after mass shootings El Paso Makeshift memorial for victims of the shooting that left a total of 22 people dead at the Cielo Vista Mall Walmart AFP/Getty Images Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators gather to protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District early Sunday morning, Wednesday, Aug. 7, 2019, in Dayton. (AP Photo/John Minchillo) John Minchillo AP Trump protests: President visits Texas and Ohio after mass shootings President Trump greets Dayton Mayor Nan Whaley as he arrives at Wright-Patterson Air Force Base AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators gather to protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District early Sunday morning, Wednesday, Aug. 7, 2019, in Dayton, Ohio. Twenty-four-year-old Connor Betts opened fire in Dayton early Sunday, killing several people including his sister, before officers fatally shot him. (AP Photo/John Minchillo) John Minchillo AP Trump protests: President visits Texas and Ohio after mass shootings Dayton Damon Smith presents a message to President Donald Trump beside a makeshift memorial in Dayton AP Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators gather in front of an inflatable "Baby Trump" to protest the presidents arrival AP Trump protests: President visits Texas and Ohio after mass shootings Miami Valley Hospital, Dayton Demonstrators gather to protest the arrival of President Donald Trump outside Miami Valley Hospital after a mass shooting that occurred in the Oregon District early Sunday morning, Wednesday, Aug. 7, 2019, in Dayton. President Donald Trump is headed to Dayton and El Paso, Texas on Wednesday to offer a message of healing and unity, but he will be met by unusual hostility in both places by people who fault his own incendiary words as a contributing cause to the mass shootings . (AP Photo/John Minchillo) John Minchillo AP Trump protests: President visits Texas and Ohio after mass shootings El Paso A photo of victim Javier Amir Rodriguez, a 15-year-old sophomore Getty Trump protests: President visits Texas and Ohio after mass shootings Dayton Demonstrators protest the visit of US President Donald Trump to the site of the mass shooting in Dayton, Ohio, on August 7, 2019. - Nine people were killed on August 4 in the city's popular Oregon District. (Photo by Megan JELINGER / AFP)MEGAN JELINGER/AFP/Getty Images MEGAN JELINGER AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso A message is left for Donald Trump AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso Signs and flags adorn the makeshift memorial for victims of the shooting that left a total of 22 people dead at the Cielo Vista Mall Walmart, in El Paso, Texas, on August 7, 2019. (Photo by Mark RALSTON / AFP)MARK RALSTON/AFP/Getty Images MARK RALSTON AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso People hug at the makeshift memorial AFP/Getty Trump protests: President visits Texas and Ohio after mass shootings El Paso People pray at the makeshift memorial AFP/Getty

Mr Trump's use of "flaming dancer" seems to be a misspelling of "flamingo dancer", which the president appears to wrongly believe is the name for a Spanish dance which is actually called flamenco.

The 73-year-old previously criticised Mr Sanford during a 2018 rally in Ohio as a man who likes "flamingo dancers from Argentina".

There is no evidence Mr Sandford's former mistress, María Belén Chapur, has ever been a flamenco dancer.

His use of the "three stooges" is a reference to three Republican candidates - including Mr Sanford - who plan to challenge Mr Trump for the Republican nomination.

Mr Trump had earlier retweeted a Twitter account titled "The 'Dirty' Truth", which prominently features links to websites promoting QAnon, a debunked, fantastical far-right conspiracy theory which claims there is a secret "deep state" plot against Mr Trump and his supporters.

The "Proud POTUS Trump & US military supporter" had posted a video in which Republican congressman John Ratcliffe criticised former FBI director James Comey during an interview with Fox News presenter Maria Bartiromo.

"Maria & John understood the dishonesty & deception from the very beginning!" Mr Trump added.

He concluded his rant with a false claim he has 94 per cent approval rating within the Republican party, wrongly stating it as a record.

Mr Trump is currently polling less than that in Gallup, Quinnipiac and Ipsos, and according to CNN, his peak popularity places him only sixth out of seven Republican presidents since the Second World War.

Mark Sanford explains why he is running against Donald Trump in the Republican primary

The president's outburst came days after former White House officials raised questions about the president's mental health.

Anthony Scaramucci, briefly White House communications director in 2017, and who now engages in public spats with Mr Trump, said on Friday his former boss was "in severe mental decline" and would "not make it" to the next election.

Another former aide told Business Insider: "His mood changes from one minute to the next based on some headline or tweet, and the next thing you know his entire schedule gets tossed out the window because he's losing his s***."

On Sunday evening, Mr Trump lashed out at a host of journalists and celebrities for his perceived lack of credit for US government efforts at criminal justice reform.

After attacking "boring musician" John Legend and his "filthy mouthed wife" Chrissy Teagen, the couple hit back, with Teagen branding Mr Trump a "p**** a** b****".