By Richard Martin,

BARCELONA (Reuters) - Chris Froome still faces a near-impossible task in his bid to catch leader Nairo Quintana after finishing alongside the Colombian in stage 17 of the Tour of Spain, which was won by Swiss rider Mathias Frank.

Froome risked losing even more ground as he struggled to keep pace with Colombians Quintana and Johan Esteban Chaves and Spaniard Alberto Contador, but the Briton caught up with the trio late on to finish 25th.

Froome remains 3:37 behind Quintana with four days of the Tour remaining. Friday's individual time trial represents his best chance of catching the Colombian, although he said on Tuesday his chances of doing so were slim.

Frank, making his first appearance in the Vuelta since 2011, raced clear of the breakaway group alongside Dario Cataldo with 22km remaining of the 177.5 km stage from Castellon to Llucena.

Frank dropped the Italian with 2km left to claim his first stage win in a Grand Tour, finishing six seconds ahead of Czech Leopold Konig of Team Sky.

Dutchman Robert Gesink was third, 11 seconds behind Frank.

"I'm super-happy. It was my big goal when I came here; I really wanted to win a stage," Frank told reporters.

"I was already close a couple of times and finally it worked out. I have had a pretty rough season; not much was working as I wanted.

"I came here and told myself, 'I just want to have fun and get a good feeling back', and finally I have a (stage) victory (in a race) after more than two years. Winning a Grand Tour stage is just amazing."

Thursday's stage is a 200.6km ride from Requena to Gandia in Valencia province with a flat finish, the second-longest stage of the Tour which finishes in Madrid on Sunday.

(Reporting by Richard Martin; editing by Ken Ferris)