World time trial champion Martin (Omega Pharma-Quick Step) attacked right at the start of the stage and stayed in front by himself but seemed destined to be reeled in with 5km to go.
However, he showed amazing resilience to stay ahead and it looked like he was going to hang on for a famous victory.
But with the finishing line just five metres away, the peloton swept past him with Morkov taking the stage win in a sprint.
Germany's Martin finished seventh in the 175 km ride from Guijuelo to Caceres.
Italian Vincenzo Nibali, the favourite for outright victory in Madrid on September 15, maintained his slender three second lead over Chris Horner of the United States in the overall standings.
"I had to try it. I was hoping two or three other guys would come with me and at the end it was so close I could have won," Martin said afterwards.
"When I found nobody else had joined me in the attack I thought about dropping back again but I opted to keep going."
As temperatures reached 30 degrees on the rolling, feature-less plains of western Spain, Martin built an advantage of seven minutes 20 seconds before the chasing pack reeled him in.
The German, with a lead of just five seconds, then pulled away again as he approached Caceres.
"I made sure I had a little bit of energy left for the finale and I never thought I would get so close," added Martin. "But it was a good day for the fans and the sport."
Morkov said he had never taken part in a bunch sprint before Thursday's chaotic dash for the line.
"As there was nobody else in the team who was faster, I had that role," the Danish national champion explained.
"I got on Fabian Cancellara's wheel and to tell the truth I had no idea when to accelerate. I thought I had calculated wrong but there was a bit of a tailwind and that helped," he said of the Swiss rider who finished third in the stage.
"Without Cancellara accelerating though I'd never have won."
1. Michael Morkov (Denmark / Saxo - Tinkoff) 3:54:15"
2. Maximiliano Richeze (Argentina / Lampre) ST
3. Fabian Cancellara (Switzerland / RadioShack)
4. Tyler Farrar (U.S. / Garmin)
5. Juan Antonio Flecha (Spain / Vacansoleil)
1. Vincenzo Nibali (Italy / Astana) 22:38:07"
2. Chris Horner (U.S. / RadioShack) +3"
3. Nicolas Roche (Ireland / Saxo - Tinkoff) +8"
4. Haimar Zubeldia (Spain / RadioShack) +16"
5. Alejandro Valverde (Spain / Movistar) +21"
- Sports & Recreation
- Chris Horner
- Italian Vincenzo Nibali