Despite an early puncture, the Liquigas-Doimo rider finished the 17th stage a solid 15th after the completely flat 46-km course through lush vineyards, which was won by Slovakia's Peter Velits.

Mosquera was 19th and is only 39 seconds behind in the overall standings, with Peter Velits in third, two minutes back.

Overnight leader Joaquim Rodriguez of Spain slumped to fifth overall after he finished a disappointing 105th on the time trial.

Nibali recognized that Mosquera was a dangerous challenge to his drive for victory in the tour, which ends on Sept 19 in Madrid.

"There's only Mosquera left to worry about now but he's going to be a big threat," the 25-year-old Sicilian, third in the Tour of Italy in May, told reporters.

"He's a great climber and there's one big day in the mountains left to go before we finish in Madrid."

Nibali said his front wheel puncture had failed to unsettle him, although it came at a very bad moment.

"The first half of the course was really tough, with a very strong headwind and I wasn't having a great time.

"Fortunately I didn't panic, and I only lost a few seconds when it could have been a lot more."

Mosquera's team manager at Xacobeo-Galicia, Alvaro Pino, was delighted his rider continued to run Nibali so close.

"Ezequiel's got a 45 percent chance of winning and we'll be looking to get that overall lead on Saturday's mountain stage," said Pino, a former winner of the Tour of Spain.

Former Under-23 World Road Race Champion Peter Velits said the first ever time trial victory of his career ahead of Russian Denis Menchov was a "complete surprise."

"I deliberately took a slow pace on the first leg of the time trial so I'd have lots of energy for the second, and that's where I won it, but i never expected this," the HTC-Columbia rider said.