Sydney: Australia were closing in on victory in the final Test and a series clean sweep after a Sri Lankan batting collapse on the third day in Sydney on Saturday.

For a time it looked as if Sri Lanka, well beaten in Hobart and Melbourne, could make a contest of it as Dimuth Karunaratne and skipper Mahela Jayawardene almost wiped out the 138-run innings deficit with a century stand before wickets tumbled.

At the close, Sri Lanka were a shaky 225 for seven and leading by 87 runs with two days left with Dinesh Chandimal on 22 and Rangana Herath not out nine.

“It could have gone the wrong way for us this afternoon but luckily enough our bowlers were good enough and they did well to pull it back,” said Australia wicketkeeper Matthew Wade, whose thrilling century set up a pre-lunch declaration.

“We’ve got to take three wickets as quickly as we can because we don’t want to be chasing too many runs on that wicket.”

After lunch, opener Tillakaratne Dilshan failed for the fifth time since his 147 in the first Hobart Test when he was caught centimetres from the ground by Phil Hughes at third slip off Johnson in the seventh over.

Jayawardene then watched four batting partners depart as he tried to keep his team’s innings together, but upon his dismissal just inside the final hour it was all downhill for Sri Lanka.

Karunaratne edged Jackson Bird to Wade for 85 to end a 108-run stand with Jayawardene in the 34th over when Sri Lanka were still trailing by six runs.

First innings topscorer Lahiru Thirimanne survived a leg before wicket review before he fell hooking Mitchell Johnson to Bird at fine leg in the 41st over.

Thilan Samaraweera completed a wretched series when he went after spinner Nathan Lyon and skied to long-on where Mike Hussey took the catch to a huge roar from the home crowd celebrating the Australian veteran’s farewell Test.

Samaraweera’s reckless third-ball duck followed scores of 7, 49, 10, 1 and 12 in the three-Test series.

A dreadful mix-up led to Angelo Mathews being run out for 16 after he failed to beat the throw from David Warner.

Jayawardene was out four balls later ending his 200-minute resistance when he edged Peter Siddle to Michael Clarke at first slip and the tourists had tumbled to 178 for six and only a lead of 40.

Dhammika Prasad became Mitchell Starc’s first wicket when caught behind for 15 heading into the final half-hour.

“We were very disappointed with the batting in the last session,” Karunaratne said.

“If Chandimal can put some runs on the board tomorrow, we can do something on this track. I think [a lead of] 150, 175 would be a good target for us.”

In the morning session Wade scored a thrilling unbeaten century batting with the tail as Australia added 90 more runs before declaring to lead Sri Lanka by 138 runs.

Wade opened up in a last-wicket stand of 39 with Bird to grab his second Test century and gave skipper Michael Clarke the opportunity to declare his team’s innings at 432 for nine in the half hour before lunch.

Wade rushed towards his teammates in the Sydney Cricket Ground Members Stand and kissed his helmet after crashing Suranga Lakmal for a boundary to raise his century off 158 balls, after setting out on the third day on 47.

He was dropped by Prasad at fine leg two balls later going for another big heave before skipper Clarke called a halt with the declaration.

Bird provided staunch support to give Wade his chance to go after his against-the-odds century. Wade was on 70 when the fast bowler came to the crease. Bird remained six not out.

Left-arm spinner Herath, who could still play a prominent role in Australia’s second innings, finished Sri Lanka’s leading wicket-taker with four for 95 off 31 overs.

Australia lost the wickets of Siddle (38), Starc (2) and Lyon (4) on the third morning.