Japanese ace Kei Nishikori came from behind to defeat Australian bad boy Nick Kyrgios and secure a place in the third round of the Shanghai Masters on Wednesday.

Coming off a semifinal defeat on home soil at the Japan Open last week, sixth-seeded Nishikori dropped the first set but came roaring back to win 1-6, 6-4, 6-4 in 1 hours, 53 minutes.

"I didn't have the best start to this match today," Nishikori told atp.worldtour.com.

"But I knew if I could take the ball early a little bit more in the second set, try to be a little more patient. My serve wasn't going in, especially in the beginning. I had three double faults in the first game. I knew my serve was one of the reasons I wasn't doing well."

After a first-set trouncing, Nishikori would bring up three set points with a backhand crosscourt winner at 4-5 in the second.

He broke on his first opportunity to level when Kyrgios volleyed wide and a Kyrgios double fault handed Nishikori two match points in the deciding set.

Nishikori, who racked up 33 winners, took it on his fourth when the Kyrgios put a backhand into the net.

"My serve went well in the second and third sets," said Nishikori. "I tried to be a little more aggressive. He was hitting big serves. But I was returning well at the same time. So I think it was a good match for my first match."

Nishikori will play South African 12th seed Kevin Anderson in the round of 16 on Thursday.