Nationalists take all three Aberdeen city constituencies as Lib Dem vote collapses.
Mr Macdonald had held Aberdeenshire Central since 1999 but was unable to hold onto his slender majority to secure a fourth term – losing out by 617 votes to the SNP candidate.
The news of Mr Stewart's victory was met by huge cheers from the SNP contingent inside the Aberdeen Exhibition and Conference Centre. All five Aberdeen constituencies are now held by the Nationalists.
Mr Stewart also paid tribute to Joanna Strathdee, the original candidate for the constituency.
Mr Macdonald, who increased his vote from 7232 in the 2007 election to 9441 but was unable to keep his seat, said: "I want to thank all voters who put their faith in the Labour party and I promise them that we will continue to speak up and stand up for the people of Aberdeen.
"I congratulate Kevin Stewart but I ask him to listen carefully to what the voters have said to him and all of the other candidates. I hope he listens to what they have said on issues such as Union Terrace Gardens and the cuts made by Aberdeen City Council.
Liberal Democrat candidate Sheila Thomson, who finished fourth, said: "In the end our swing has not been as bad as it has been for the Liberal Democrats in other parts of the country.
Scottish Conservatives candidate Sandy Wallace was pleased with his party's showing.
Meanwhile, the SNP's Maureen Watt held back the tears as she gained Aberdeen South and North Kincardine from the Liberal Democrats.
Ms Watt received just under 12,000 votes while her main rival John Sleigh slumped to a third place finish behind Labour's Greg Williams after only winning 4994 votes.
Nicol Stephen had previously won this seat three times in a row but Lib Dem candidate Sleigh's failure summed up a dismal night for the Lib Dems.
Brian Adam held on to his seat at the newly-named Aberdeen Donside constituency with a landslide victory.
The SNP candidate, who won the constituency previously known as Aberdeen North in 2003 and 2007, increased his majority by picking up 55% of the vote to cap a dream night for the Nationalists as they claimed all three Aberdeen constituencies.
Labour candidate Barney Crockett came second with 7613 votes, ahead of Ross Thomson of the Conservatives in third place with 2166 votes.
During an emotional speech, Mr Adam called the Granite City the "powerhouse of Scotland" and claimed it could once again be the powerhouse of Europe.
He said: "I'm absolutely delighted to have doubled my majority. There is no doubt at all that the people of Aberdeen are backing the SNP in a major way, despite the difficulties that the city has had.
Mr Adam said the SNP's emphatic victories sent out a clear message to Westminster.
Barney Crockett, the Labout candidate, admitted it had been a very disappointing election for his party.
He said: "What has undone us is that Labour's campaign was not as effective as it should have been. It did not focus sufficiently on the populist nature of the SNP's attraction. We never drew attention to its weaknesses.
A dejected Millie McLeod, who finished fourth with 1606 votes, admitted it had been a dire campaign for the Liberal Democrats.