Donald Trump has lashed out at two liberal Supreme Court justices and demanded they recuse themselves from cases related to his administration in an extraordinary attack on the judicial system.

Mr Trump attacked Justices Sonia Sotomayor and Ruth Bader Ginsburg on Twitter over perceived slights against himself and his administration.

The president’s outburst appeared to be inspired by a Fox News segment from host Laura Ingraham which said Justice Sotomayor had accused Republican-appointed justices of being “biased in favour of Trump”.

“This is a terrible thing to say. Trying to ‘shame’ some into voting her way? She never criticised Justice Ginsberg [sic] when she called me a ‘faker,’” Mr Trump wrote, referring to a comment by Ms Ginsburg from 2016.

“Both should recuse themselves on all Trump, or Trump related, matters! While ‘elections have consequences’, I only ask for fairness, especially when it comes to decisions made by the United States Supreme Court!”

Donald Trump celebrity president: A decade in two halves Show all 29 1 /29 Donald Trump celebrity president: A decade in two halves Donald Trump celebrity president: A decade in two halves Trump styles his 'You're fired!' pose in his Trump Tower office in June 2012. At the time he was known as a reality TV star on The Apprentice Diane Bondareff/Invision/AP Donald Trump celebrity president: A decade in two halves He was also well known as the patron of the Miss Universe competition Getty Donald Trump celebrity president: A decade in two halves Early signs of Trump's ambition for the presidency can be found everywhere. Not least in his 2011 book 'Time to get tough: Making America #1 again' Getty Donald Trump celebrity president: A decade in two halves Trump with Piers Morgan in November 2010. Piers Morgan has long held that he and Trump are good friends Getty Donald Trump celebrity president: A decade in two halves Trump appeared on Fox & Friends, his favourite show, in August 2011 Getty Donald Trump celebrity president: A decade in two halves Trump considered running in the 2012 election, where he would have faced Barack Obama. He is speaking here at an event for a Republican women's group Getty Donald Trump celebrity president: A decade in two halves Trump was subject to a Comedy Central roast in 2011. He is pictured here being roasted by rapper Snoop Dogg Getty Donald Trump celebrity president: A decade in two halves Given that this Trump store is in the lobby of Trump Tower, it can be said that Trump sells merchandise of himself out of his own home Getty Donald Trump celebrity president: A decade in two halves Trump held meetings with prominent Republicans when considering his 2012 bid. He is pictured here with Alaska governor Sarah Palin Getty Donald Trump celebrity president: A decade in two halves He didn't end up running in 2012 afterall, instead endorsing Republican candidate Mitt Romney AFP/Getty Donald Trump celebrity president: A decade in two halves Trump's golf course in Aberdeen proved controversial in 2012 when he began lobbying the Scottish government against wind power in order that they wouldn't install turbines off the shore by his new course Getty Donald Trump celebrity president: A decade in two halves He even gave evidence to a Scottish parliamentary committee discouraging wind energy AFP/Getty Donald Trump celebrity president: A decade in two halves He still found time for a round of course AFP/Getty Donald Trump celebrity president: A decade in two halves On 16 June 2015, Trump announced that he would run for the presidency of the United States in the 2016 election as a Republican Getty Donald Trump celebrity president: A decade in two halves His campaign was divisive, courting controversy wherever he went. Ultimately he was declared the Republican candidate in June 2016 Getty Donald Trump celebrity president: A decade in two halves Trump took part in the TV debate against opponent Hillary Clinton on 9 October Getty Donald Trump celebrity president: A decade in two halves Trump and wife Melania vote in the presidential election on 8 November 2016 AFP/Getty Donald Trump celebrity president: A decade in two halves Hillary Clinton conceded defeat at 2:50am on 9 November and president-elect Trump swiftly delivered his victory speech to a crowd of supporters Getty Donald Trump celebrity president: A decade in two halves News coverage around the world focused on the huge political upset that Trump's victory spelled AFP/Getty Donald Trump celebrity president: A decade in two halves Trump met with president Obama to discusss transition planning on 10 November. AFP/Getty Donald Trump celebrity president: A decade in two halves Donald Trump and Nigel Farage pose in the golden elevator at Trump Tower on 12 November 2016. Farage was the first British politician to meet with Trump after the election LeaveEUOffical/Twitter Donald Trump celebrity president: A decade in two halves The inauguration of Donald Trump took place on 20 January 2017. Trump's press secretary Sean Spicer boasted that the crowd was the 'largest ever' to witness an inauguration, a claim that was proved not to be true Getty Donald Trump celebrity president: A decade in two halves In his first 100 days as leader, Trump signed 24 executve orders, the most of any president AFP/Getty Donald Trump celebrity president: A decade in two halves One of Trump's most memorable election pledges was to build a wall between the US and Mexico. He is standing here in front of a prototype for a section of the wall Getty Donald Trump celebrity president: A decade in two halves Trump's meetings with other world leaders have provided no short supply of photo opportunities Getty Donald Trump celebrity president: A decade in two halves Trump was welcomed to the UK by the Queen and a state banquet was held at Buckingham Palace in his honour Reuters Donald Trump celebrity president: A decade in two halves Not everyone welcomed the president. Mass protests were held in London throughout his visits in both 2018 and 2019 EPA Donald Trump celebrity president: A decade in two halves One of the most significant meetings Trump has held with another leader was with North Korea's Kim Jong Un. In June 2019, Trump became the first sitting president to set foot in North Korea Getty Donald Trump celebrity president: A decade in two halves 2020 will see president Trump fight for a second term in office, who knows what the next decade will bring? Getty

In 2016, Justice Ginsburg called Mr Trump a "faker" who has "no consistency about him" and said she could not imagine him as the president.

Although she did not heed Mr Trump's call for her to resign, she did express regret over the comment, which she said was "ill-advised".

Justice Sotomayor, who is one of four liberal-minded justices on the court, wrote a scathing dissent on Friday which criticised her conservative colleagues for being too eager to side with the Trump administration on emergency requests to the court.

“Claiming one emergency after another, the government has recently sought stays in an unprecedented number of cases,” Justice Sotomayor wrote.

“It is hard to say what is more troubling; that the government would seek this extraordinary relief seemingly as a matter of course, or that the court would grant it.”

The Trump administration has used emergency requests to the Supreme Court to force through controversial policies, such as the so-called "public charge" rule which would make it more difficult for immigrants to obtain legal status if they use public benefits like food stamps.

Mr Trump’s comments came less than two weeks after Bill Barr, the US attorney general, said the president’s tweets about the Justice Department made it “impossible” for him to do his job.

“I cannot do my job here at the department with a constant background commentary that undercuts me,” Mr Barr told ABC News.

The president’s attack on Justices Ginsburg and Sotomayor drew anger on social media, with some commentators accusing him of acting like a dictator.

“He’s corrupted the Senate, Justice Dept and DNI/intelligence and now he’s going after the Supreme Court,” Andy Ostroy, a Democrat-supporting political commentator, wrote on Twitter.

“Wake up America, he’s creating a dictatorship.”

Brian Fallon, the executive director of Demand Justice, a liberal judicial advocacy group, said Mr Trump was attacking Justice Sotomayor for “speaking the truth”, while political commentator David Frum warned that more attacks from the president were likely.

“As Supreme Court moves closer to deciding the Trump business document cases before June, we will likely hear more of these attacks on the non-Trump-appointed justices both from Trump himself and from pro-Trump media,” Mr Frum said.

“Sotomayor complains that the Supreme Court shows undue deference to the federal government requests for stays of injunctions,” he added.

“Trump interprets these comments about undue deference to the government as ‘bias in favour of Trump’ - because in his mind, ‘the government’ = HIM.”

The president’s outburst also came one day after it was reported that a group of pro-Trump activists including Ginni Thomas, the wife of Justice Clarence Thomas, had compiled lists of “disloyal” government officials.

US media reports have claimed Ms Thomas gave suggestions to the White House about which officials should be fired for not supporting Mr Trump’s administration.