Alloa Athletic scraped into the First Division play-off final despite being given a fright by visitors Brechin City.
Andrew Jackson scored in the fourth minute to halve Alloa's first-leg lead, but Kevin Cawley replied for Paul Hartley's side after 36 minutes.
Brechin were back ahead through Alan Trouten's 52nd-minute penalty.
Calum Elliot equalised from the spot after 68 minutes and Jackson's last-minute winner came too late.
Holding a 2-0 advantage from the first leg, Alloa, who finished second in Division Two, fell behind to Jackson's third-minute strike.
He slammed the ball into the top corner after good work from Ryan Ferguson down the right.
But, after Cawley and Elliot had been expertly denied by Brechin goalkeeper Michael Andrews, Cawley levelled with a controlled volley from Graeme Holmes' pass in the 36th minute.
The equaliser led to a bust-up between the two dugouts, with managers Hartley and Ray McKinnon sent to the stands.
Brechin regained the lead from the penalty spot after Jonathan Tiffoney was judged to have handled in the area and Trouten slotted home.
Alloa were then awarded a penalty of their own when Ewan Moyes brought down Elliot and the striker dusted himself down to score.
Jackson ensured a nervy ending when he converted David McKenna's pass from close range in the last minute, but the hosts held on for a 4-3 aggregate success.
Bain, Tiffoney, Gordon, Doyle, Meggatt, Moon, McCord (Young 65), Simmons, Holmes, Elliot (Ferns 87), Cawley. Subs Not Used: Docherty, Grehan, McDowall.
Cawley 36, Elliot 68 pen.
Andrews, Paul McLean, Hay, Moyes, McLauchlan, Ryan Stewart (Jonathan Stewart 72), Rodger (Pursehouse 53), Ferguson (McKenna 66), Trouten, Carcary, Jackson. Subs Not Used: Brady, Nelson.
Trouten, Hay, Moyes.
Jackson 4, Trouten 52 pen, Jackson 90.