Alistair Brownlee retained his Olympic men's triathlon title to win Britain's 20th gold medal of the Rio Games, with brother Jonny claiming the silver.
Alistair, 28, pulled away from 26-year-old Jonny about halfway through the 10k run in sweltering conditions.
The Yorkshiremen were close throughout the swim, cycle and road race stages, with Alistair walking over the line six seconds ahead.
Henri Schoeman was third, claiming South Africa's first triathlon medal.
Alistair Brownlee is the first athlete to win successive Olympic triathlon titles, while Jonny improved on the bronze medal he won at London 2012.
The brothers were part of a 10-strong group that pulled away during the 40km bike stage, having comfortably negotiated the 1,500m open-water swim from Copacabana Beach.
Mario Mola of Spain, ranked number one in the world after winning four ITU World Series events this year, finished more than a minute behind the Brownlees in eighth.
Britain's other entrant, Gordon Benson, did not complete the race after crashing on the seventh lap of the eight-lap cycle leg.
What they said
Alistair Brownlee: "I was pretty confident we would get first and second but I didn't know which way round it would be.
"I just had the edge on Jonny but he has killed me in training and I have been going through hell. It has been so hard. I have woken up in pain every day.
"The swim wasn't that quick but we knew the first two laps on the bike would be crucial. The last few weeks we have been training to commit and, boy, we did.
"As soon as we got to halfway I knew we were going to get two medals and it was just a run for it."
Jonny Brownlee: "I'm used to getting beaten by him, but at the start of the day the dream was to get gold and silver and that is what we have done.
"We had a plan and really committed, and when Alistair pushed on I thought it I would be risking a medal to go with him.
"Maybe in four years if he is older and greyer he will be that bit slower... but maybe he won't be."
BBC Sport's chief sports writer Tom Fordyce
"That might seem like the result all expected, but these have been he most testing of four years for Alistair Brownlee - every season an injury, every season a doubt that he could ever stay fit for long enough to hit his peak once again.
"But no-one can suffer in a race like the double Olympic champion, no-one push themselves as hard.
"The greatest one-day racer in history has once again proved himself unbeatable when it matters most."
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.