Hearts slumped to a fourth straight defeat for the first time in more than four years as goals from Derek Young and Scott Wilson handed Dunfermline a rare win over the Tynecastle side.
Not since March 1999, when Dundee inflicted the last of six successive defeats, have Hearts had such a poor run but they could certainly not be faulted for effort as they laid siege to the Dunfermline goal in the closing stages as they battled for an equaliser.
Hearts were first to threaten and Paul Hartley fired a free-kick straight at Derek Stillie in the sixth minute. Four minutes later, makeshift striker Kevin McKenna also tested Stillie from distance, but the Pars keeper was well positioned to hold the Canadian's left-foot effort.
Andy Tod headed a Barry Nicholson corner over after 12 minutes as Dunfermline came into the game and moments later Craig Brewster shot wide after Stevie Crawford dummied Derek Young's cross from the right.
Scott Severin fired a couple of headers over for Hearts but it was Dunfermline who struck first. A long ball out of defence was flicked on by Brewster to Crawford and the Scotland striker made the by-line before playing a clever back-heel into the path pf Derek Young.
The former Aberdeen man, who scored his first of the season last week, struck it first time from 15 yards out to just beat Craig Gordon on his inside post.
McKenna flashed a header wide as Hearts tried to hit back while Scott Severin tried an ambitious 40-yard lob after a miscued Stillie clearance fell straight to him with Stillie still out of position.
The equaliser finally came, after 28 minutes, with a move straight from the training ground. Neil MacFarlane won a free-kick on the right and with the Pars defence expecting Hartley to fire it into the box, the former Hibs man played it square to stand-in skipper Alan Maybury and the Irishman swept a low drive past Stillie from 20 yards.
The visitors almost went ahead three minutes after the interval. Severin fired a long ball out of defence that caught the Pars defence flatfooted. Graham Weir nipped in behind Scott Wilson and Tod but, with only Stillie to beat, rushed his shot and pushed it wide.
Andrius Skerla produced an overhead clearance as Hearts continued to press and Weir was crowded out in the home penalty box.
With Hearts on top, Dunfermline's second goal was as cruel as it was avoidable. Maybury gave away a needless free-kick on the left which Darren Young flighted into the box where Wilson rose above the Hearts defence to head past Gordon.
Boosted by the lead, Dunfermline continued to press with Gordon denying Wilson's drive then watching Nicholson's effort flash just inches over.
But that was almost the last of Dunfermline as an attacking force as Hearts pushed relentlessly for the equaliser.
Stillie turned a Robbie Neilson 30-yarder round for a corner, Andy Webster was inches away from connecting with a Maybury cross, before heading just over from a Jean-Loius Valois cross.
Substitute Gary Wales was also denied from the edge of the area as Dunfermline hung on.