KRASNAYA POLYANA, Russia (AP) -- Alexander Legkov made sure the Russian flag finally flew highest at the Sochi cross-country skiing venue - and for these entire Olympic Games.
On the last day of the games, Legkov led a Russian medal sweep in the men's 50-kilometer race to give the host nation its first cross-country gold at the Sochi Games. It also clinched top spot in the overall medals table for Russia with 12 golds and 32 medals overall.
''To win a gold medal on the final day, and win the medals table for Russia, I couldn't be happier,'' Legkov said.
Legkov won a four-way sprint to the finish at the end of the freestyle mass-start race Sunday, pulling away from teammates Maxim Vylegzhanin and Ilia Chernousov on the final straight. On a perfect final day for the hosts, Vylegzhanin was second after beating Chernousov in a photo finish, 0.7 seconds behind Legkov.
Martin Johnsrud Sundby of Norway was the only competitor who could keep up with the Russians toward the end but was passed by Chernousov on the final straight and finished fourth, one second behind the winning time. That left Norway with 11 golds for the Sochi Games.
''This is priceless,'' said Legkov, who earned his first Olympic gold when he finished in 1 hour, 46 minutes, 55.2 seconds. ''It's more valuable than my life, I can't express how I feel. For 15 years I've been trying for this result.''
Russia had fallen short of expectations in the cross-country competition until the final race, with only two silver medals from the men's relay and team sprint events.
But like the country's biathlon team - which won the concluding men's relay for its first gold on Saturday - the Russians got it together in the last event.
''We were ready to fight and ready to win,'' said Vylegzhanin, who earned his third silver medal of the games. ''We are really glad to get the three top spots in our home Olympics race. It was a really big celebration because we wanted to win for our supporters, for our whole country.''
Legkov demonstrated his form in the men's relay last weekend, when he set the fastest time of all skiers on the third leg and helped Russia to get the silver.
And after most of the leading contenders stuck together for 48 kilometers on Sunday, Legkov upped the tempo and created the four-man breakaway group. Legkov led coming into the stadium and stayed in front.
Yelena Valbe, the former Olympic champion who is now head of the Russian ski federation, said the medal sweep in the last event was beyond the team's expectations.
''Yesterday lots of people said we will have the podium but I was thinking that it was a joke,'' Valbe said. ''Still, I was believing in the guys and they have proved they are good enough to win.''
It was the second straight podium sweep in cross-country, after Norway finished 1-2-3 in the women's 30K race on Saturday.
Aside from Sundby, the overall World Cup leader, none of the other pre-race favorites could match the Russians' speed toward the end. Johan Olsson of Sweden, the 50K world champion, was 32.1 seconds back in ninth place, while defending Olympic champion Petter Northug of Norway came 18th, 44.5 back.
The race capped a miserable Olympics for Northug, who leaves Sochi without a medal after earning four in Vancouver in 2010, including two golds.
''It was obvious that Petter Northug wasn't in a very good shape,'' Legkov said. ''I really admire him, he is really a king of the skis. But I can tell you that finally I am just like him.''
Dario Cologna's chances for a third gold in Sochi ended when his left ski broke shortly after the 45K mark. The Swiss skier received a new one, but had lost too much time to the leaders to catch up and finished 27th.
''I think another (skier) drove over my skis. It was just one fast moment, then it was over,'' said Cologna, who won the 30K skiathlon and 15K classical races. ''Of course I am disappointed. That was a big chance to win another medal. In the moment the disappointment is bigger but when I go home I will sure be very happy with these Olympics.''