Jurgen Melzer had never taken a set from Rafael Nadal in three previous meetings. That was until today when the 13th-seeded Austrian upset the top-ranked Spaniard 6-1, 3-6, 6-3 in the third round of the Shanghai Masters. It was Nadal’s second defeat in less than two weeks. Melzer came out firing in the first set, breaking Nadal twice, winning 12 of 20 return points and pounding booming forehands. A weary Nadal, who lost in the semis at Bangkok 12 days ago before winning his seventh title of the year at Tokyo on Sunday, regained his composure to take the second set — breaking Melzer for the only time of the match at 2-3. “I think the key was to put a lot of pressure on him,” Melzer said. “You cannot let him play his game. You’ll always be second. That play with his forehand, he’s just too good. So I tried to take the ball early. I was serving really well, especially on big moments. I executed my game plan, which was putting a lot of pressure, especially on his forehand.” Melzer broke at 15 in the sixth game of the final set and then served two aces to hold serve for a commanding 5-2 lead. Nadal survived three match points in the next game — the first on a huge Melzer forehand that was called out, but was successfully challenged by the Austrian, giving Rafa another chance. Melzer held at love to close out the match in one hour and 59 minutes. “I’m really happy,” Melzer said. “When you have match-point and you’ve basically won the match, all the pressure falls off because I didn’t hear the call. But then serving at 5-3, I stepped in on a backhand on the first point and that helped. It was a really good service game.” Melzer served 14 aces and won 83 percent of his first service points, while converting three of 12 break point opportunities. Nadal had one ace and committed an uncharacteristic 27 unforced errors. “This isn’t a surprise for me. I didn’t play well,” Nadal said. “I felt slow on court and I made more mistakes than usual. In general, I am a little bit more tired than usual, physically and mentally.”You can’t expect to win every week. All the good work is done for me for the year.” Melzer faces Juan Monaco in a quarterfinal matchup tomorrow.