He was originally detained as a prisoner of war. He was then flown to Miami where he was tried and convicted on drug trafficking and money laundering charges in a civilian court. Diplomatic immunity certainly didn't help him, and I doubt it would help Assange either.