Hibernian's David Gray (second from right) scores the winner. Picture: SNS

It was the Edinburgh club which struck first, Anthony Stokes getting Hibs off to the perfect start after just three minutes only for ex-Hibs striker Kenny Miller to head home a Ranges equaliser.

Stokes and Miller hit the woodwork before Andy Halliday fired Rangers ahead only for Stokes to equalise and then Gray to claim his moment of glory, sparking off wild scenes of jubilation among the Hibs support as thousands of them flooded onto the pitch, their joy uncontainable.

One set of goalposts were demolished as sporadic fighting broke out with some Rangers fans also hurdling the barrier.

Sign up to our daily newsletter The i newsletter cut through the noise Sign up Thanks for signing up! Sorry, there seem to be some issues. Please try again later. Submitting...

The banner opposite the tunnel read “Time for Heroes” as the teams took to the field, but little could those Hibs fans holding it have dreamt of the response they’d get with the Edinburgh club ahead in less than three minutes.

It was the persistence of player of the year John McGinn who initiated the move with a typically surging run and although he was fouled by Halliday, referee Steven McLean played what turned out to be a fantastic advantage.

Jason Cummings picked up the loose ball and set Stokes away, the on-loan Celtic striker racing into the penalty area and was composure personified as he guided the ball into the far corner of Wes Foderingham’s net.

Hibs almost had a second seven minutes later as they appeared to have caught Rangers, without a competitive game in three weeks, absolutely cold. Darren McGregor led the charge from the back, his pass to Stokes who touched it on to Lewis Stevenson.

Anthony Stokes of Hibernian celebrates opening the scoring. Picture: Getty

He, in turn, slid it forward intending to find Cummings. Rob Kiernan appeared to be in control but slipped, offering Cummings a chance only for his shot to be blocked. Then Cummings found himself one-on-one with Danny Wilson but the former Hearts skipper came out on top.

It had certainly been a frenetic start from Hibs with Alan Stubbs’ players first to every ball but a slip by Paul Hanlon followed by a foul by the defender on Jason Holt offered Rangers their first opportunity only for Halliday to drive his free-kick into the wall and a couple of minutes later he sent a speculative effort well wide.

But Hibs were quickly back on the front foot, McGinn attempting an audacious chip which had Foderingham quickly backtracking and thankful to see the ball land on the roof of his net.

Rangers would have been grateful not to have been swept aside but they hauled themselves level, pretty much against the run of play, in the 27th minute as James Tavernier found space to deliver a cross which found Miller rising above McGregor to bullet home an unstoppable header.

Martyn Waghorn of Rangers takes on Lewis Stevenson of Hibs. Picture: Getty

Incredibly, Hibs could have been back ahead within 60 seconds, Stokes beating Foderingham all ends up with a tremendous strike which crashed back off the inside of the goalkeeper’s right hand post.

And Rangers were also left cursing the woodwork when Miller got his head to Barrie McKay’s corner, the former Hibs striker only a couple of inches away from giving his side an unlikely lead.

Rangers boss Mark Warburton would have been happier with what he had seen in that spell but the Ibrox club could just as easily have been trailing by some distance, Stokes driving past Tavernier before unleashing a low shot which Forderingham just managed to touch wide , the goalkeeper was then right on top of Cummings as he got on the end of David Gray’s cross before Stokes threw himself at McGregor’s cross only to send his header wide.

Stokes had proved to be the dangerman for Hibs throughout the first half and he was at it again five minutes after the restart, firing in a dipping shot from 25 yards which had Forderingham scrambling down at his right hand post to touch the ball past.

Hibs are seeking to win the Scottish Cup for the second time in their history. Picture: Anthony Brown

But it was Rangers who took the lead for the first time in the game in the 64th minute, Halliday allowed too much time as he sized up a left foot shot which sped across Hibs goalkeeper Conrad Logan and in at the far post

Stubbs reacted by throwing on james Keatings and Liam Henderson for Cummings and Liam Fontaine, moving from a 3-5-2 formation to 4-4-2 in an effort to get that equaliser, Stokes going close but not close enough as he cut in from the left only to see his shot rise over the target.

The Republic of Ireland internationalist, however, wasn’t to be denied ten minutes from time when he outmuscled Tavernier to get his head to Henderson’s corner, bulleting the ball high into Foderingham’s net.

And as the game moved into four minutes of added on time, only the fingertips of Foderingham prevented Keatings getting on the end of Stokes cross. Not that it mattered, Gray powering in a header from Henderson’s corner to win Hibs the Scottish Cup for the first time since 1902.

Rangers: Foderingham Tavernier, Kiernan, Wilson, Wallace, Zelalem, Halliday, Holt, Waghorn, Miller, McKay.

Substitutes: Bell, Law, Clark, Shiels, Burt.

Rangers walk the pitch prior to the William Hill Scottish Cup Final. Picture PA

Hibs: Logan, McGregor, Hanlon, Fontaine, Gray, Fyvie, McGeouch, McGinn, Stevenson, Cummings, Stokes

Substitutes: Oxley, Henderson, Bartley, Boyle, Keatings, Gunnarsson, Dagnall.

Referee: Steven McLean

Match report and updates will appear here.

Anthony Stokes of Hibernian celebrates opening the scoring. Picture: Getty

Martyn Waghorn of Rangers takes on Lewis Stevenson of Hibs. Picture: Getty

Hibs are seeking to win the Scottish Cup for the second time in their history. Picture: Anthony Brown