Darren Mackie was unfortunate not to put the visitors in front early on when he was put through by Willie John Kiely but former Dundee keeper Jamie Langfield was on hand to save. Shortly afterwards, Mackie pulled an effort over the crossbar before Kiely also came close, his lob going wide of the target.
A Richard Buckley slip almost let Athletic in and midway through the opening period they went ahead when Ryan O'Leary, under pressure from Donnelly, allowed the forward in to shoot past Ryan Esson.
Langfield again came to Dunfermline's rescue when he saved well from Foster, who had been played in by Mackie. The Dons were to rue that miss a few minutes later when Athletic made it three, Donnelly scoring directly from a free kick after Fergus Tiernan had pulled the same player down.
Aberdeen never gave up and Foster saw a good effort go just wide on the stroke of full time.