The 21-year-old dominated the women's 48kg, lifting 92kg in the snatch and 108kg in the clean and jerk for a total of 200kg to finish first in weightlifting's lightest category.
"I dedicate the medal to our king. That is the Thai way," Sopita told reporters after she became the fourth women's weightlifter from Thailand to win an Olympic gold medal.
The 88-year-old Thai king is the world's longest-reigning monarch and is widely revered in the country where his frail health is a matter of public concern.
He is confined to a wheelchair and has not been seen or spoken in public for nearly a year. Earlier this week the palace said he was being treated for fever and water on the brain.
Sopita, a regular lifter in the 53kg class, took full advantage of the withdrawal through injury this week of hot Chinese favourite Hou Zhihui to win with ease.
The 5ft 1ins Thai hoisted 8kg more than silver medallist Sri Wahyuni Agustiani of Indonesia, while evergreen Japanese lifter Hiromi Miyake took bronze with a total of 188kg.
Sopita -- who hails from a family of boxers -- was in control throughout at the the 6,000-capacity Riocentro Pavilion 2, and went into the clean and jerk leading by seven kgs.
Her only stumble came when she failed to lift 110kg in her final attempt of the night. That left Agustiani needing to haul 115kg to take first place. The Indonesian had two opportunities but never came close.
"I was surprised that she was going for it but I was still very confident I was going to win," Sopita said afterwards.
"I believed I could do it but it just wasn't meant to be," lamented Agustiani.
Miyake's bronze came after she won silver at London four years ago to become Japan's first ever female medal winner in weightlifting.
The 30-year-old was in tears on Saturday after failing to lift her first two snatch attempts, but she was all smiles later as she squeaked onto the podium by 1kg.
- Doping cloud -
Miyake, whose father won Olympic bronze in weightlifting in 1968 Olympic is competing in her fourth Games and didn't rule out a fifth on home soil at Tokyo 2020.
"It would be a wonderful place here to wrap up my career but I need to go away and think about it very carefully," she said.
The weightlifting started under a cloud of doping after it was reported earlier in the day that Cypriot weightlifter Antonis Martasides had been sent home from the Olympic Games after failing a drugs test.
The Cyprus Mail said on its website that Martasides had tested positive for a banned substance following an out-of-competition test on July 25 in Athens.
Martasides' credential for Rio was revoked following the test.
Weightlifting has long been plagued by doping scandals.
Russia and Bulgaria, both traditional powerhouses, are banned from the weightlifting competition in Rio for repeated doping offences.
The International Weightlifting Federation (IWF) also punished North Korea, Romania, Azerbaijan, Uzbekistan and Moldova by reducing their allocation of lifters.