MELBOURNE, Australia — Andy Murray turned the tables in dramatic fashion on Thursday to defeat Tomas Berdych in a 6-7 (6-8), 6-0, 6-3, 7-5 and reach a fourth final at the Australian Open.

The sixth-seeded Murray will face the winner of Stan Wawrinka and four-time winner Novak Djokovic.

Murray and Berdych battled for nearly three and a half hours in one of the longest matches of the fortnight, with Murray steadying after an intense and often ill-tempered opening set which took an hour and a quarter.

Murray ended it with his 15th ace of the first of three match points.

Murray admitted there was a bit of extra tension in the air, with Berdych now coached by his own former coach Dani Vallverdu, who left the Murray camp in 2014.

Berdych served for the first set leading 5-3 but was broken on the way into a tiebreaker. Berdych won the opener after saving a Murray set point.

That’s when Murray changed tactics and reversed the momentum.

“I was obviously disappointed, I had a couple of chances, I felt I played better as the set went on,” Murray said. “In the second I started out very aggressive.”

That strategy paid off, with the seventh-seeded Berdych dropping his level as he was blanked in half an hour for a set each.

Murray, defeated in his previous Melbourne finals by Roger Federer and twice by Djokovic, then broke in the sixth game of the third set, enough to go up 2-1 sets.

The fourth stayed on serve until Murray found an opening for a 6-5 lead on a break; he then served out victory with ease.

“I changed tactics in the second set after I got more comfortable with his ball and the conditions,” said Murray, the 2013 Wimbledon winner. “I had been feeling quite rushed.

“I tried to play aggressive on his service games and make him do most of the running. I got some momentum back that way.”

Murray has a career record of 8-6 vs. Wawrinka but trails Djokovic 15-8 in their series.