Sochi, Russia (SportsNetwork.com) - Neither man was perfect, but Japan's Yuzuru Hanyu edged three-time world champion Patrick Chan of Canada for gold in men's figure skating at the Sochi Olympics.

Hanyu won the short program Thursday with a record score of 101.45, leading Chan by just under four points. Despite mistakes from both on Friday, Hanyu managed to also win the free skate to give Japan its first gold medal in the men's competition.

Canada has still never won gold in men's figure skating. Chan became the third silver medal winner in the nation's history, following Elvis Stojko (1994, '98) and Brian Orser (1984, '88). Orser just happens to be Hanyu's coach.

Kazakhstan's Denis Ten won bronze with a brilliant effort. He had been ninth after the short program and had one of the few clean skates of the night.

American Jason Brown was sixth after the short program and was the last skater to take the ice Friday. He had a chance to win a medal, but a stumble early in his routine left him 11th in the free skate and ninth overall.

Ten was in the second-to-last group and set the bar with a sensational effort that netted him a free skate score of 171.04 and a two-night total of 255.10.

There were still six skaters in the last group and only two managed to top Ten's score.

Spain's Javier Fernandez was first in the last group and was in bronze medal position after the short program, but he did not thrill the judges on Friday. His score of 166.94 was fifth-best and dropped him directly behind Ten, where he eventually finished.

It was basically a two-man competition for gold between Hanyu and Chan.

Hanyu was the first of the two to take the ice for the free skate and he fell on his opening quad jump. A second mistake occurred moments later when his hands touched the ice while completing a triple-flip.

Still, his artistry and other technical elements enabled him to finish with a score of 178.64 and a total of 280.09. It still left the door open for Chan, who was next on the ice.

After opening with a perfect quad-toe, triple-toe combination, Chan touched the ice while landing each of his next two jumps -- a quad and a triple-lutz. He also had a couple of other wobbles during his program and earned a score of 178.10 to finish at 275.62.

At age 19, Hanyu became the second-youngest Olympic men's figure skating champion. American Dick Button was 18 in 1948 when he won the first of his two gold medals.

The only man in the field with a previous Olympic medal, Japan's Daisuke Takahashi, finished sixth. He won bronze four years ago in Vancouver for Japan's first Olympic men's figure skating medal.

American Jeremy Abbott finished 12th after a personal best of 160.12 in the free skate. He performed brilliantly on Friday after a nasty fall in his short program left him 15th.