The Court of Arbitration for Sport (CAS) in Lausanne has annulled all Mellouli's results and suspended him for 18 months, dating back to November 30th last year when the offence was committed.
"All the results obtained by the swimmer since that date are cancelled. This includes the medals, times and prizes achieved at the 12th world championships in Melbourne," FINA said.
Mellouli, who tested positive for amphetamines at a meet in Indiana, won the 800 metres freestyle and took the silver medal in the 400 freestyle at the worlds in March this year. He was the first Tunisian to win a world long-course swimming title. FINA appealed to CAS to impose a two-year ban, saying the Tunisian federation was too lenient in sanctioning Mellouli with just a reprimand and a warning.
Stanczyk given belated gold
CAS partially admitted the appeal but said in a statement:
"The Panel has considered that, if the swimmer was indeed guilty of negligence, such negligence was not sufficiently serious to suspend him for two years, which would have meant an automatic ban from the 2008 Olympics Games in Beijing."
Mellouli, a student at the University of Southern California at the time of the offence, said he had taken an Adderall pill two days before he tested positive so he could stay awake to finish a university assignment.
The ruling means Poland's Przemyslaw Stanczyk, second behind Mellouli in the world 800 freestyle, is set to move up to gold.
In the 400 freestyle, won by Park Tae-hwan of South Korea, Australia's Grant Hackett would take Mellouli's world silver.
Chinese all clean in doping tests
Mellouli could lose title