Ross Caldwell curled in a wonderful 90th-minute strike to give Hibernian their first Edinburgh derby win at Tynecastle in four years.
Darren Barr poked Hearts in front on the stroke of half time as keeper Ben Williams messed up from a corner.
But a stunning free-kick from Leigh Griffiths levelled matters early in the second half.
And Caldwell's cool finish from 14 yards lifted Hibs back above Hearts into ninth place in the SPL table.
With little at stake other than local bragging rights, the 300th derby in major competitions was a lively affair, eclipsing the three dreary draws served up in this season's previous league meetings.
Jordon Forster enjoyed a solid debut in central defence and Alex Harris caught the eye with a lively performance on the right wing but it was Caldwell, making just his second start, who was the toast of the Hibs teenagers.
The 19-year-old did not get too many glimpses of goal but staked a claim for a Scottish Cup final place with his excellent winning strike.
The visitors were the brighter side in the opening exchanges, knocking the ball around well in midfield and utilising the pace of the Harris.
However, Pat Fenlon's side needed two good headed clearances to prevent them from falling behind as Williams dropped a corner from Kevin McHattie, with Barr and Michael Ngoo denied by Lewis Stevenson and Alan Maybury inside the six yard box.
Jamie MacDonald got down low to save a first-time shot from Harris after an exchange with Caldwell.
The Hearts keeper made a similar stop from Caldwell's deflected, raking effort from the left edge of penalty box and a panicked clearance from McHattie fell to Harris but the winger could not profit as he too lacked composure.
Griffiths lined up a long-range free kick, bringing to mind his effort that was not seen by the officials crossing the line by some distance in the last meeting of the teams, but this time his fizzing effort was deflected wide by the defensive wall.
Otherwise, Hibs leading scorer was being well shackled by Andy Webster.
In the final minute of the first half, Hearts were awarded a corner when Kevin Thomson knocked the ball out of play under pressure from Hamill.
The Hibs midfielder wanted a foul but appeared to have slipped and his mood turned darker still when the home side took the lead from the resultant set-piece.
Williams was badly at fault as he got nowhere near McHattie's delivery as Tom Taiwo blocked Ngoo's header on the post and Barr was quickest to react as he prodded the ball in from a prone position on the turf.
Hibs were level within three minutes of the second half as Harris was upended 25 yards out and Griffiths stepped up to curl a fabulous free-kick into the top corner.
Harris then flashed a great ball across the face of goal, with Griffiths inches away from connecting.
Hearts responded with a Hamill free kick that had to be clawed away by Williams and a bobbling volley from Walker whizzed narrowly wide from 20 yards.
Paul Hanlon then made a crucial sliding block from a Ryan Stevenson cross that appeared destined for Ngoo in front of goal.
With the clock reaching 90 minutes, substitute Scott Robertson broke into the penalty area from the left to slip a pass to Caldwell and the striker took a touch near the penalty spot before finding the top corner.
The visiting fans went wild and only had to wait a few more minutes to celebrate their first unbeaten season against their city rivals since 2000/01.
Live Text Commentary
Full Time The referee signals the end of the game.90:00 +2:46
Ross Caldwell takes a shot. Jamie MacDonald makes a save.90:00 +1:01 Substitution
Substitution Gordon Smith is brought on as a substitute for Jason Holt.89:56
Scott Robertson provided the assist for the goal.89:56 Goal scored
Goal! - Ross Caldwell - Hearts 1 - 2 Hibernian Ross Caldwell fires in a goal from the edge of the penalty area to the top right corner of the goal. Hearts 1-2 Hibernian.88:51
Shot from just outside the box by Jamie Walker misses to the left of the target.88:20
Dale Carrick crosses the ball.87:38
Corner taken by Alex Harris from the right by-line played to the near post, save by Jamie MacDonald.85:46
Foul by Alan Maybury on Ryan Stevenson, free kick awarded. Free kick crossed left-footed by Kevin McHattie.84:28
Centre by David Smith.83:18 Booking
Booking Jamie Walker goes into the book for unsporting behaviour.82:07
Unfair challenge on Tom Taiwo by Jason Holt results in a free kick. Free kick taken by Paul Hanlon.79:59
Alex Harris is ruled offside. Jamie MacDonald restarts play with the free kick.79:59 Substitution
Substitution Scott Robertson on for Kevin Thomson.79:05 Substitution
Substitution David Smith on for Mehdi Taouil.76:59
Foul by Jason Holt on Kevin Thomson, free kick awarded. Free kick taken by Lewis Stevenson.72:39 Substitution
Substitution (Hearts) makes a substitution, with Dale Carrick coming on for Michael Ngoo.70:45
Alex Harris crosses the ball, Jamie Hamill makes a clearance. Corner taken by Alex Harris from the left by-line, Close range headed effort by Paul Hanlon clears the crossbar.68:09
Kevin Thomson fouled by Jamie Walker, the ref awards a free kick. Direct free kick taken by Ben Williams.67:53
A cross is delivered by Jamie Hamill, Alan Maybury makes a clearance.
The ball is swung over by Ryan Stevenson, clearance by Paul Hanlon.64:40
Inswinging corner taken left-footed by Kevin McHattie, Unfair challenge on Alan Maybury by Michael Ngoo results in a free kick. Direct free kick taken by Ben Williams.63:05
The ball is delivered by Ryan Stevenson, clearance made by Lewis Stevenson. Corner taken by Kevin McHattie played to the near post, Kevin Thomson makes a clearance.61:51
Free kick awarded for an unfair challenge on Mehdi Taouil by Tom Taiwo. Free kick crossed left-footed by Kevin McHattie from left channel.60:02
Jamie Walker gives away a free kick for an unfair challenge on Jorge Claros. Paul Hanlon takes the direct free kick.58:54
Jorge Claros concedes a free kick for a foul on Mehdi Taouil. Andy Webster takes the direct free kick, Jamie Walker produces a right-footed shot from just outside the area that goes wide left of the goal.56:21
Jordon Forster concedes a free kick for a foul on Michael Ngoo. Jamie Hamill shoots direct from the free kick, save by Ben Williams. Inswinging corner taken by Kevin McHattie from the right by-line played to the near post.55:54
John Sutton gives away a free kick for an unfair challenge on Jordon Forster. Direct free kick taken by Ben Williams.55:24
Jorge Claros gives away a free kick for an unfair challenge on Mehdi Taouil. Free kick crossed by Kevin McHattie, save by Ben Williams.54:54
Free kick awarded for an unfair challenge on John Sutton by Jorge Claros. Kevin McHattie restarts play with the free kick.54:29
Unfair challenge on Leigh Griffiths by Jamie Hamill results in a free kick. Direct free kick taken by Paul Hanlon.53:31
The ball is sent over by Jamie Hamill.53:00
The assistant referee signals for offside against Leigh Griffiths. Jamie MacDonald restarts play with the free kick.52:20
Centre by Jamie Hamill.50:30
Corner from left by-line crossed in by Alex Harris, save by Jamie MacDonald. Tom Taiwo concedes a free kick for a foul on Jamie Hamill. Free kick taken by Jamie MacDonald.48:19 Booking
Booking The referee shows Kevin Thomson a yellow card for dissent.47:17 Goal scored
Goal! - Leigh Griffiths - Hearts 1 - 1 Hibernian Leigh Griffiths hits the back of the net with a direct shot from the free kick. Hearts 1-1 Hibernian.46:31
Mehdi Taouil concedes a free kick for a foul on Alex Harris.45:01
The referee starts the second half.45:00 +1:31 Half time
Half Time The whistle is blown to end the first half.44:28
Michael Ngoo provided the assist for the goal.44:28 Goal scored
Goal! - Darren Barr - Hearts 1 - 0 Hibernian A goal is scored by Darren Barr from close in to the bottom left corner of the goal. Hearts 1-0 Hibernian.44:01
Kevin McHattie takes a inswinging corner to the near post,38:51
Jamie Walker takes a shot from just inside the penalty box which clears the bar.38:18
Ross Caldwell concedes a free kick for a foul on Andy Webster. Jamie MacDonald takes the direct free kick.36:03
The referee blows for offside. Jamie MacDonald takes the direct free kick.34:51
Free kick awarded for a foul by Kevin McHattie on Tom Taiwo. Free kick taken by Alan Maybury.33:12
Leigh Griffiths takes a inswinging corner from the right by-line played to the near post, Kevin McHattie manages to make a clearance.32:20
Lewis Stevenson gives away a free kick for an unfair challenge on Jason Holt. Jamie Hamill takes the direct free kick.31:16
The ball is swung over by Alex Harris.29:03
Free kick awarded for a foul by Mehdi Taouil on Leigh Griffiths. Leigh Griffiths has a direct shot on goal from the free kick, Darren Barr manages to make a clearance. Corner taken by Alex Harris, save by Jamie MacDonald.27:18
A cross is delivered by Leigh Griffiths, Jamie MacDonald makes a save.26:03
Ross Caldwell takes a shot. Save made by Jamie MacDonald.25:44
The ball is swung over by Jamie Hamill, save by Ben Williams.24:18
The referee blows for offside against John Sutton. Jordon Forster takes the free kick.23:12
Free kick awarded for a foul by Kevin McHattie on Jordon Forster. Ben Williams takes the direct free kick.22:18
Centre by Alex Harris, clearance by Andy Webster.21:05
Jamie Walker produces a right-footed shot from just outside the box that misses to the right of the goal.20:11
Corner taken by Alex Harris, Darren Barr makes a clearance.19:59
A cross is delivered by Ross Caldwell, clearance by Jamie Hamill.19:47
Alex Harris takes a shot. Save made by Jamie MacDonald.11:47
Corner taken by Alex Harris from the left by-line played to the near post, clearance made by Ryan Stevenson.10:17
Inswinging corner taken from the right by-line by Kevin McHattie, Ben Williams makes a save. Darren Barr takes a shot. Blocked by Lewis Stevenson. Michael Ngoo takes a shot. Blocked by Alex Harris.9:44
Unfair challenge on Kevin McHattie by Ross Caldwell results in a free kick. Jamie MacDonald takes the free kick.7:01
Jordon Forster fouled by Michael Ngoo, the ref awards a free kick. Ben Williams takes the direct free kick.6:52
Alex Harris delivers the ball, Andy Webster manages to make a clearance.3:20
The offside flag is raised against Leigh Griffiths. Free kick taken by Andy Webster.1:22
The ball is crossed by Alex Harris, clearance by Darren Barr.0:44
Free kick awarded for a foul by Mehdi Taouil on Kevin Thomson. Kevin Thomson crosses the ball in from the free kick, Andy Webster manages to make a clearance.0:00
The referee starts the match.
Live data and text provided by our data suppliers