Louis Smith won silver on a tie-break with gold medallist Berki, while Max Whitlock claimed bronze.
Smith, the 2008 Olympic bronze medallist, was the last to perform on the apparatus and watched as his rival, double world champion Berki, posted a score of 16.066.
Smith stepped up for his routine to thunderous applause from the Host Nation crowd and matched Berki's score, but lost out on claiming Britain's first Olympic Gymnastics gold medal due to a lower execution score.
Whitlock finished in bronze medal position after scoring 15.600 with his routine.
'I'm very happy, I have no idea what happened,' Berki said.
'Maybe tomorrow I will and then I might believe that I have won the Olympic title.
'When I watched Louis Smith I thought that he could win as he had a very strong exercise.
'But the judges saw me as being the better performer today. To beat two British athletes and to do it in London is a great achievement.
'I am a big fan of Louis Smith. He is much younger than me and I expected him to win.'