However the acquittal was overturned after prosecutors appealed and she was handed a death sentence - only for the Federal Court in administrative capital Putrajaya, her final avenue of appeal, to rule in her favour Tuesday.
Exposto was initially found not guilty in a lower court after it heard how she was set up in an online boyfriend scam by a man who identified himself as "Captain Daniel Smith", a U.S. soldier stationed in Afghanistan.
Maria Elvira Pinto Exposto, with her lawyer Muhammad Shafee Abdullah.
"I never had any doubt she would be freed", the 38-year-old said, blinking back tears.
The compulsory death penalty for 11 offences in Malaysia - including drug trafficking, murder, treason and waging war against the King - is set to be abolished under the changes.
Maria Elvira Pinto Exposto looked delighted and kissed her lawyer in court after the ruling, which brings down the curtain on a saga that began in 2014 when she was arrested with crystal methamphetamine in her backpack while transiting in Kuala Lumpur.
Exposto had maintained that she was duped into carrying the bag with the medicine by a good friend of her on-line boyfriend, who claimed to be a US soldier serving in Afghanistan.
Foreign Affairs Minister Marise Payne in a statement thanked consular officers and Ms Exposto's legal team for securing her release. Furthermore, her lawyer said that she was innocent and had always believed the same.
They spoke by phone and email for more than a year between 2013 and 2014.
'Smith would sing to me a few times a day and send love poems as well, ' she added. "He made me fall in love with him", she said.
'He made me feel loved, he made me feel wanted, ' Exposto told the previous court hearing, saying the supposed USA serviceman would send her photos of himself.
Exposto said she had gone to Shanghai to meet a United States soldier with whom she had an online relationship and who had been asked to wear a bag full of clothing.
After three years in prison, she was found not guilty of drug trafficking in December 2017, with the court accepting her argument that she had been unaware of the presence of drugs in her luggage.
Exposto had arrived from Shanghai and was scheduled to take a connecting flight to Melbourne when she was detained in Malaysia. She didn't have to have her bags checked. She volunteered, ' professor Monica Whitty said.