NEW YORK (Reuters) - Daniil Medvedev once reveled in his role as the villain of Flushing Meadows but on Sunday the Russian completed his transformation to unlikely hero after taking Rafa Nadal the distance in a pulsating U.S. Open final.

Slideshow ( 3 images )

Despite losing to the Spaniard in a five-set thriller, Medvedev’s performance suggests more Grand Slam finals are in his future and that he could be a genuine challenger to the ‘Big Three’ -- Nadal, Roger Federer and Novak Djokovic.

The 23-year-old Russian, who had got on the wrong side of fans at Flushing Meadows with a string of on-court antics, arrived at his maiden Grand Slam final to a chorus of boos.

However, he gradually won over the Arthur Ashe Stadium crowd as the match wore on, showing heart and skill in abundance to fight back from two sets down before Nadal claimed the 7-5 6-3 5-7 4-6 6-4 thriller that stretched four hours and 50 minutes.

“I know earlier in the tournament I said something in kind of a bad way and now I’m saying it in a good way: That it’s because of your energy that I’m in the final,” said Medvedev as he accepted the runner-up trophy.

“You guys were pushing me to prolong this match because you want to see more tennis and because of you guys I was fighting like hell.”

Medvedev, who had never previously made it past the fourth round of a Grand Slam, became the player fans loved to hate when he angrily snatched a towel from a ballperson in his third round match and showed the crowd his middle finger.

He then sarcastically thanked the crowd after the match, saying, “the energy you’re giving me right now, guys, I think it will be enough for my next five matches.”

He picked up $9,000 in fines for his behavior in that match, taking his total to $19,000 for the first three rounds at Flushing Meadows having earlier been fined for verbal abuse and throwing his racket.

However, a contrite Medvedev later said he regretted his behavior and apologized for the animosity, telling the crowd after his quarter-final victory over Stan Wawrinka that “what I’ve done is not good”.

His match against Nadal marked a fourth straight tournament final for Medvedev, who arrived at the U.S. Open fresh off a victory at Cincinnati during a remarkable summer run.

On Sunday, he said the tournament had made him see the error of his ways.

“You guys see that I can also change because I am a human being,” Medvedev told the crowd after applauding Nadal’s 19th Grand Slam title.

“Thank you very much from the bottom of my heart.”