Hardie (centre) has scored eight goals in nine games for Dunfermline
Martin Hardie's double gave Dunfermline a comback victory that puts them four points ahead of Fife rivals Raith Rovers at the top of Division One.
Chris Baird had prodded the visitors from Kirkcaldy into the lead after goalkeeper Chris Smith spilled a 41st-minute Laurie Ellis header.
But Hardie headed a deserved equaliser from six yards after 55 minutes.
And the veteran midfielder curled home a 25-yard free-kick 12 minutes from time for the league leaders.
Rovers had made a bright start in front of a sell-out derby crowd of 11,000 at East End Park, but soon it was Dunfermline who were piling on the pressure.
Baird (right) opened the scoring for Raith Rovers at East End Park
Visiting goalkeeper Andy McNeil allowed a cross to bounce over his head and it nearly entered the net, then Hardie failed to make contact in front of goal.
A powerful David Graham drive was deflected wide of a Rovers post and Liam Buchanan headed powerfully over.
Andy Kirk sent a volley crashing against a post, but Rovers were defending doggedly and took the lead four minutes from the break.
Chris Smith looked odds on to save an Ellis header following a free-kick, but the Pars goalkeeper allowed the ball to squirm from his grasp and Baird hammered it high into the roof of the net from close range.
Rovers took heart and created the first clearcut opportunity of the second half, when Ellis set up Gregory Tade, but the forward sent his side-footed effort over the crossbar.
McNeil nervously tipped a Chris Higgins header over his crossbar and, from Joe Cardle's inswinging corner, Hardie was left free at the back post and he headed powerfully home from six yards.
Hardie returned the compliment almost straight from the kick-off, threading a ball through to Cardle, but the winger's shot was turned wide by McNeil.
From the corner, Kirk headed just wide as Dunfermline went close to going ahead.
However, it was Hardie who turned the game - and the promotion race - in the home side's favour.
The well-travelled 35-year-old, who joined Dunfermline from St Johnstone in January, sent his free-kick past McNeil and into the corner of the net for his eighth goal in nine games.
McNeil denied Graham with a good save from close range after a Steven McDougall cross, but two goals were enough to put the Pars in pole position for promotion to the Scottish Premier League with two games remaining.
Dunfermline: Chris Smith, Woods, Higgins, Keddie, McCann, David Graham, Mason, Hardie, Cardle (Dee Graham 74), Buchanan (McDougall 66), Kirk (Dowie 84). Subs Not Used: Paterson, Phinn.
Booked: Hardie, Woods.
Goals: Hardie 55, 78.
Raith: McNeil, Craig Wilson (Weir 84), Campbell, Murray, Ellis, Walker, Davidson, Kevin McBride, Simmons, Baird, Tade. Subs Not Used: McGurn, Ferry, Williamson, Hill.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.