Nibali kept the red leader's jersey for Friday's seventh stage, a second consecutive flat ride favoring sprinters that will stretch 206 kilometers (128 miles) from Almendralejo to Mairena del Alijarafe. The Giro d'Italia champion kept his 3-second advantage over American rider Christopher Horner.
Martin said it wasn't the plan to break away alone and stay in front all the way through the transition stage that took riders along the rolling hills of western Spain.
The Omega Pharma-Quick Step rider from Germany opened up a seven-minute gap at one point and appeared to have just enough left on the final gentle climb before Cancellara led the last-gasp charge to overtake him.
"I was hoping two, three, four guys would go with me, but nobody did, and it didn't make any sense to go back," said Martin. "I gave it a try."
The three-week race ends in Madrid on Sept. 15.