Mills retained her Olympic title, partnered by Eilidh McIntyre, adding to silver won at London 2012.
Mills and McIntyre's moment was slightly clouded by an on-the-water protest from France, which was thrown out within 20 minutes.
With the result standing, the duo took Team GB's third sailing gold medal of the Games.
A golden finale was a stunning climax to the Olympics for Mills, who was one of Team GB's flag bearers at the opening ceremony.
Going into the medal race, Mills and McIntyre enjoyed a 14-point lead over French pair Camille Lecointre and Aloise Retornaz.
After sitting in second for the majority of the medal race, the Brits claimed fifth place - one place above the French pair - to seal gold.