The unanimous ruling by a three-judge Federal Court bench dealt a final blow to Djokovic's hopes of chasing a record 21st Grand Slam win at the Australian Open that starts on Monday.
The Serbian player went to the airport in Melbourne just hours later. Federal agents escorted him and his team from the business lounge to the gate, where he boarded an Emirates flight bound for Dubai. The flight took off shortly before 11 pm local time.
In a rollercoaster ride, Djokovic was first detained by immigration authorities on 6 January, ordered released by a court on 10 January and then detained on Saturday again pending Sunday's court hearing.
He said after the ruling he was extremely disappointed as it meant he could not take part in the tournament.
"I respect the Court’s ruling and I will cooperate with the relevant authorities in relation to my departure from the country," he said in a statement and wished the tournament well.
Djokovic, 34, had appealed against Immigration Minister Alex Hawke's use of discretionary powers to cancel his visa. The minister had said Djokovic could be a threat to public order because his presence would encourage anti-vaccination sentiment amidst Australia's worst coronavirus outbreak.
Chief Justice James Allsop said the court ruling was based on the lawfulness and legality of the minister's decision in the context of the three grounds of appeal Djokovic's legal team lodged.
"It is no part of the function of the court to decide upon the merits or wisdom of the decision," Allsop said, adding that the three judges were unanimous in their ruling. The full reasoning behind the ruling would be released in the coming days, he said.