Donald Trump's ban from Facebook and Instagram has been upheld by Facebook's Oversight Board.
But it criticised the indefinite nature of the ban as beyond the scope of Facebook's normal penalties.
It has ordered Facebook to review the decision and "justify a proportionate response" that is applied to everyone, including ordinary users.
The former president was banned from both sites in January following the Capitol Hill riots.
The Oversight Board said the initial decision to permanently suspend Mr Trump was "indeterminate and standardless", and that the correct response should be "consistent with the rules that are applied to other users of its platform".
Facebook must respond within six months, it said.
At a press conference, co-chair Helle Thorning-Schmidt admitted: "We did not have an easy answer."
She added that she felt Facebook would "appreciate the decision".
"We are telling Facebook to go back and be more transparent about how it assesses these things. Treat all users the same and don't give arbitrary penalties."
In response, Facebook said it would "consider the board's decision and determine an action that is clear and proportionate".
The board also made a number of recommendations about how Facebook should improve its policies and the social network promised to "carefully review" these.
The Board was due to announce its decision last month but delayed the ruling in order to review more than 9,000 public responses to cases, it said.
In the meantime, Mr Trump, who is also banned from Twitter, launched a new website on Tuesday to update supporters with his thoughts.
Following the ruling, Mr Trump wrote that "what Facebook, Twitter, and Google have done is a total disgrace".
"Free speech has been taken away from the President of the United States because the radical left lunatics are afraid of the truth," he said, referring to himself as president.
"The people of our country will not stand for it! These corrupt social media companies must pay a political price, and must never again be allowed to destroy and decimate our electoral process," he said.
The administration of Mr Trump's successor, Democratic President Joe Biden, declined to comment on Facebook's ruling on Wednesday.
But White House Press Secretary Jen Psaki said it was President Biden's view that "major platforms have a responsibility related to the health and safety of all Americans to stop amplifying untrustworthy content, disinformation and misinformation".
What did the Board say?
The ruling means that Mr Trump's suspension remains in place for now.
The Oversight Board decided that Mr Trump had broken Facebook's community standards, and upheld the ban.
But it is the "indefinite" part of the ban that it took issue with because that is not within its own rules.
"It is not permissible for Facebook to keep a user off the platform for an undefined period, with no criteria for when or whether the account will be restored," it said in a statement.
Applying that type of ban to Mr Trump was not following any clear procedure, it said.
Facebook cannot make up the rules as it goes, and anyone concerned about its power should be concerned about allowing this. Having clear rules that apply to all users and Facebook is essential for ensuring the company treats users fairly. This is what the Board stands for.— Oversight Board (@OversightBoard) May 5, 2021
The Board argued that Facebook had essentially issued "a vague, standardless penalty and then [referred] this case to the Board to resolve".
It said doing so meant "Facebook seeks to avoid its responsibilities" - and sent the decision back to Facebook.
Co-chair Michael McConnell justified the timeframe saying that it was a decision "not to be rushed" and admitted that the firm may decide to throw it back to the Oversight Board yet again.
Setting up a "Supreme Court" to rule on tricky issues seemed like a smart move by Mark Zuckerberg. Whatever the Oversight Board decided, Facebook's boss could say "not my fault, blame the judges".
But that's unlikely to wash here. There can be no more divisive issue than President Trump's presence on a platform credited or blamed by many for his electoral success in 2016 and probably crucial if he decides to run again in 2024.
Now, the Oversight Board has thrown the hot potato right back into Mr Zuckerberg's lap.
He and his team have been told to go away and have a long hard think about how they handle tricky cases like this one. They will have to decide the meaning of the term "newsworthy" and conduct a proper inquest into the platform's role in the events of 6 January.
And at the end of it all, Facebook will still have to decide what to do about Donald Trump.
Mark Zuckerberg could be forgiven for wondering whether setting up this body was such a good idea after all - and why he is paying the generous salaries of the board's members.
What is the Oversight Board?
Often referred to as "Facebook's Supreme Court", it was set up to rule on difficult or controversial moderation decisions made by Facebook.
It was established by Facebook boss Mark Zuckerberg but operates as an independent entity, although its wages and other costs are covered by Facebook. It is made up of journalists, human rights activists, lawyers and academics.
The committee has already ruled on nine cases including a comment that seemed derogatory to Muslims. The post from a user in Myanmar, removed for breaking hate-speech rules, was found by the board not to be Islamophobic when taken in context.
What happened to Trump's account?
Following the Capitol Hill riots on 6 January, Facebook announced it was banning Mr Trump for breaking its "glorification of violence" rules.
Hundreds of his supporters entered the complex as the US Congress attempted to certify Joe Biden's victory in last year's presidential election.
Mr Trump was acquitted of a charge of inciting insurrection at the US Capitol in his second impeachment trial in February, after being accused of encouraging the violence in which five people lost their lives.
The social network had originally imposed a 24-hour ban after the attack which was then extended "indefinitely".
Mr Zuckerberg announced that the risks of allowing Mr Trump to post were "simply too great".
The former president has also been banned from Twitter and YouTube.