Tim Paine admitted Ben Stokes was "too good" for Australia after the all-rounder played one of the great Test innings to help England claim a remarkable win at Headingley that levelled the Ashes.

Australia needed just one more wicket on day four to take a 2-0 lead in the five-match series and retain the urn with two matches to play.

But Stokes evoked memories of his heroics in last month's Cricket World Cup final with a scarcely believable 135 not out as England chased down 359 – their highest fourth-innings total in a Test win.

There were more than a few nervy scrapes along the way with Marcus Harris just failing to cling onto a catch when Stokes undercooked one and the England star was given not out when seemingly trapped lbw by Nathan Lyon with Australia out of reviews.

Australia skipper Paine conceded it was a tough defeat to take but played tribute to Stokes' knock and insisted his side can still get the job done in the remaining two Tests.

"It's hard to take, obviously, losing that from that position is difficult but you have got to tip your hat sometimes," Paine said at the post-match presentation after a day of high drama. 

"I thought Ben Stokes played an unbelievable innings and in the end it was too good for us. That's probably the best Test innings I've seen and the rest of the team thought the same thing.

"We thought we had enough runs. I thought our bowlers did a tremendous job [on Saturday] to get us in the position that we were. 

"We thought that if we continued that this morning we'd create enough chances to win the game. In the end we probably did but Joe Denly and Joe Root [who made a century stand on day three] were both excellent and kept them in the hunt.

"Overall I thought it was a terrific Test match. When Ben is at the crease you are always worried. 

"There are always probably things you could have done differently but cricket is a game of inches. But it's not the end of the world. 

"We are here to win the series and we've still got two opportunities to show what we're made of."