The US authorities have been trying to get him extradited from his New Zealand mansion for ages so that he can face copyright charges. The extradition case has reached New Zealand's Supreme Court which ruled that the US could have him if it wanted. But at the same time it overturned another lower court's decision, effectively granting him the right to appeal.
The court ruled that Dotcom and his three co-accused were liable for extradition on 12 of the 13 counts the FBI is seeking to charge them with.
But it also ruled that the Court of Appeal had erred in dismissing judicial review requests from Dotcom, and granted him the right to continue with them.
The FBI alleges that Megaupload facilitated copyright infringement on a huge scale, but Dotcom's lawyers argue that the website was never meant to encourage copyright breaches.
If he is extradited, he faces a lengthy jail term.
In response to the ruling, he tweeted a statement from his lawyers which read: "For the Dotcom team, and especially for Kim and his family, it is a mixed bag."
"There is no final determination that he is to go to the United States. However, the court has not accepted our important copyright argument and in our view has made significant determinations that will have an immediate and chilling impact on the internet."
In 2012, he was arrested when armed police stormed his Auckland home in a dramatic dawn raid, which was later to become the subject of its own legal enquiry, when Dotcom sued for damages.
A district court in New Zealand ruled in 2015 that he could be extradited, but a series of appeals and judicial reviews followed.
Lawyers for Mr Dotcom argued that his actions did not amount to criminal offences in New Zealand, and were not extraditable.