SHANGHAI -- Andy Murray defeated an error-prone Roger Federer 6-3, 6-2 Sunday to win the Shanghai Masters for his second title of the year.

Murray broke the Swiss player's serve four times while fighting off six break points. He also served six aces, while Federer had three.

Murray didn't drop a set in the tournament and now has beaten Federer eight times in 13 meetings, including the last two. Murray's win Sunday was the most lopsided match the two have played.

Andy Murray didn't drop a set in Shanghai and now has beaten Roger Federer in eight of 13 matches. AP Photo

"I love the challenge of playing against him. I don't fear playing him," Murray said. "I don't know if my game matches up well against his or not, but I've played some of my best tennis against Roger."

Federer will rise to become the second-ranked player as a result of reaching the final. He was attempting to win his 64th career title, which would have tied him with Pete Sampras for fourth on the all-time list.

After easily beating Robin Soderling in the quarterfinals and Novak Djokovic in the semifinals, Federer struggled to keep the ball in play against Murray, particularly on the forehand side.

Federer hit three forehand errors and a double-fault to give Murray a break in the first game of the match. The Scot then broke Federer a second time to win the set by chasing down a drop shot and flicking a forehand into the open court for a winner.

"I got a lot of free points on my serve," Murray said. "I didn't give him any chances to go for it. I threw some with a lot of kick on, some slice, some into his forehand."

Federer had four break chances to come back early in the second set, but Murray saved them all with several well-placed serves and -- on the last one -- a backhand passing shot down the line to end a lengthy rally.