Last updated on .From the section Olympics

Gymnast Max Whitlock won his second Olympic gold medal of the day by pipping British team-mate Louis Smith in the men's pommel horse.

Whitlock, 23, had earlier gained Britain's first-ever Olympic gymnastics gold with victory in the men's floor.

Smith, 27, had to settle for silver in the pommel - as he did at London 2012.

Whitlock's double success in the Olympic Arena helped Britain move up to 13 gold medals in Rio, taking their overall tally to 35.

"I've completely outdone myself," Whitlock told BBC Sport.

The penultimate man to go in the final, Whitlock scored 15.966 to push Smith, on 15.833, down to second place.

Alexander Naddour of the United States took bronze with 15.700.

I knew I had to refocus - Whitlock

Whitlock now has five Olympic medals, earning bronze in the all-around last week to add to bronzes in the team event and pommel horse at London 2012.

His victory on the pommel came less than two hours after winning the floor.

"I knew I had to refocus as I had another job to do," he said.

Smith won his third individual medal in three successive Games, after winning bronze at Beijing 2008 and silver - ahead of Whitlock - four years later.

He narrowly missed out on gold in London and this latest near-miss means he is still searching for an Olympic title.

Smith was left in tears as he received his medal on the podium, before embracing his team-mate warmly as he stepped up.

"Max has been an absolute star in this competition," Smith told BBC Sport.

"He's been incredible. It's hard to keep composure when a team-mate has just won a medal. I just tried to keep focus."

Smith briefly retired following the 2012 Olympics before returning to the sport in January 2014.

Whitlock prospered in his absence, becoming Britain's first male world champion with a narrow win over his compatriot last year.

In the pommel, Smith went fifth of the eight finalists and set the score to beat with a wonderfully executed routine.

He was guaranteed a medal when Armenia's Harutyun Merdinyan could not match his score but had to settle for silver when Whitlock overtook him.

Whitlock creates British gymnastics history - again

Earlier on Sunday, Whitlock created British gymnastics history for the second time in Rio.

Having won Britain's first all-around Olympic medal in 108 years by taking bronze on Wednesday, he gained the nation's first Olympic gymnastics gold in the men's floor, with a score of 15.633.

Whitlock finished ahead of Brazilian pair Diego Hypolito (15.533) and Arthur Mariano (15.433), who took silver and bronze respectively.

Fellow Briton Kristian Thomas finished seventh with 15.058.

Whitlock won silver at the 2015 World Championships behind Japan's Kenzo Shirai, who was expected to be the man to beat in Brazil.

The Briton, the third gymnast to go in Sunday's floor final, set the standard with a virtually flawless routine.

Whitlock faced an anxious wait to see if he would end up on the podium with five more men still to go.

But he knew by the time 19-year-old Shirai took to the mat for the penultimate routine that he was assured of a medal.

Shirai, aiming to become the first Japanese man to win the event since 1968, produced an error-strewn performance, scoring 15.366 to go fourth.

It meant only American Samuel Mikulak could deny Whitlock gold and, after a tense few moments, the Briton's success was confirmed.

Inspired to try gymnastics? Find out how to get into gymnastics with our special guide.

"Winning the floor was a surprise," he said. "I never go into any competition thinking about medals but just thinking about doing my job.

"You only get about one minute to show what you've been working on for four years.

"I wasn't watching any of the other floor routines so it just hit me when I realised what I'd done."

Analysis

Dan Keatings, British gymnast, on BBC One:

"I don't think Max can quite believe he's won two gold medals. He came on to the scene in 2012, won the bronze there and kicked on. He's Commonwealth champion, European champion, world champion and now double Olympic champion. He's done everything."

Beth Tweddle, former Commonwealth champion and BBC Sport analyst:

"I think it helped Max going so far up in the order in the men's floor. He was then able to just sit back and relax. He looked more nervous waiting for the result than he did before his routine. We were hoping for a sneaky bronze but where he was brilliant, others faltered."

Arise Sir Max? Social media reaction

BBC Sport presenter Gabby Logan suggested Whitlock deserves a knighthood

Great Britain long jumper Greg Rutherford hailed Whitlock's win in the men's floor

Fellow gymnast Sam Oldham predicted a New Year's Honour for his team-mate - even before he won a second gold

Former Olympic gymnast and BBC commentator Daniel Keatings full of praise for Louis Smith

Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.