The pair, silver medallists at the 2012 Olympics in London, only needed to finish the medal race on Thursday to win gold, and came in eighth.
New Zealand’s Jo Aleh and Polly Powrie won silver and Camille Lecointre and Helene Defrance of France took bronze.
Britain have now won 21 gold medals in Rio and a second in sailing after
Wales’ Mills, 28, and 36-year-old Clark, who comes from Essex, held a 20-point lead going into the medal race after winning three times and never finishing below eighth in the 10 races in the first series.
The medal race had been scheduled to take place on Wednesday, but had been postponed until Thursday because of a lack of wind.
Only a disqualification or technical problem could have denied Mills and Clark, fourth in the world rankings, and they stayed out of trouble as they were eighth out of 10.
Slovenia won the final race but it was not enough to earn them a medal. The United States were in bronze medal position until a late mistake dropped them down to last place in the medal race, and seventh overall.
In a statement Mills said, ” I can’t believe it. It has actually been the best feeling ever,”
“We have forgotten all about [the silver medal in] London. We are so proud to come back after it and we’ve worked so hard to get the upgrade to gold. Thank you to everyone back home for the support.
“It is all we have ever dreamed of and we are so happy.”
Clark added: “The first moment I sailed with Hannah, I knew we could do something special.
The only exception was London 2012, when Sir Ben Ainslie’s fourth career Olympic title was his country’s only gold of the Games.
Mills and Clark’s success takes Britain to the top of the Rio sailing medal list, by virtue of Nick Dempsey’s silver in the windsurfing, with the Netherlands also winning two golds.
It also means Britain have won 12 Olympic sailing gold medals in the last four Games.