Victory was also Murray's first ever on clay over Nadal in seven attempts and stretched the Scot's perfect start on the surface this season to 9-0 after wining his first ever clay court tournament earlier this week in Munich.
Defeat will see nine-time French Open champion Nadal slip to seventh in the world rankings, the first time he has been outside the top five in 10 years.
"To play Rafa in Spain is extremely tough, but this is the reason why we play tennis for these matches, it is one of the toughest things in tennis to try and win against Rafa on clay," said Murray.
"I will keep trying to play well in the next few weeks with Roland Garros just round the corner."
Nadal was searching for his third straight title in the Spanish capital, but his first of the European clay court swing after defeats to Novak Djokovic in the Monte Carlo Masters semi-final and a shock exit to Fabio Fognini at the Barcelona Open last month.
"Evidently today wasn't the game I wanted or hoped to play. I tried until the end but it is not a day I am going to remember," said Nadal.
"Even so, this week has been a very important week for me in which I have recovered sensations which I haven't felt on a tennis court for some time."
Murray's week began in chaotic circumstances as his Munich final against Philipp Kohlschreiber was delayed until Monday due to bad weather and then his first match in Madrid against the same opponent finished at 3 o'clock on Thursday morning.
However, he has been in supreme form since getting married to long-term girlfriend Kim Sears a month ago and celebrated his win by writing "marriage works" on the court-side camera.
Murray forced Nadal onto the back foot from the off by winning 12 of the first 14 points in racing into a 3-0 lead.
Nadal had two break back opportunities in the seventh game and one more as Murray served for the set at 5-3, but he couldn't convert.
A similar pattern followed in the second set as a combination of some brilliant deep hitting by Murray and errors from Nadal gifted the word number three a break in the first game.
Murray backed that up by holding to love and moved to the brink of victory by breaking again in the following game.
Nadal resisted enough to force the Olympic champion to serve out for his 10th Masters Series title.
However, the 14-time Grand Slam champion handed the final game to Murray as he failed to put the ball in play on four returns to seal victory in just under 90 minutes on court.