(CNN)Zambia's newly-elected president, Hakainde Hichilema, has been sworn into office after pulling off a stunning rare victory for an African opposition leader.
Hichilema was inaugurated Tuesday morning at a ceremony attended by leaders such as Tanzania President Samia Suluhu Hassan and Malawi leader Lazarus Chakwera.
Zambia's second female Vice President Mutale Nalumango was also sworn in during the ceremony.
Hichilema defeated outgoing President Edgar Lungu in a landslide by almost one million votes in his sixth attempt at becoming ruler of Zambia.
It was a stunning turnaround for the politician known as HH -- Hichilema spent several months in prison in 2017 for what were widely seen as politically motivated treason charges. The charges were dropped under intense international pressure.
After initially indicating he may challenge the result, Lungu addressed the nation following the elections, saying: "Based on the revelations issued at final results, I will comply with the constitutional provisions for a peaceful transition of power.
Despite conceding defeat early, Lungu was booed by some of the crowd as he made his way to the stage at the packed Heroes stadium in the capital Lusaka to hand over power.
Hichilema called Tuesday "a new dawn in Zambia," in a tweet ahead of the ceremony. "As I sit here in our vehicle being driven to Heroes Stadium, I see the love, the joy and the jubilation as people line the streets on our way. I'm overwhelmed with gratitude. I love you all so much," he added.
An example for Africa
Opposition leaders from other African countries were also invited to the event.
Nelson Chamisa, opposition leader in Zimbabwe, told CNN: "This is a significant and fantastic for what is possible for the future of Africa. Zambia is an inspiration to stubborn laggards in democracy. Strong institutions are key for effective power transfer and smooth transitions," he said in a statement when asked about the significance of today's inauguration.
Chamisa added that Zambia is an excellent example to be emulated on the continent.
"Africa in general and Zimbabwe in particular needs leaders not rulers, strong institutions - not strong men. Leaders must lead and leave, serve and go. Zimbabwe must be free and Democratic. Freedom can be delayed but never denied," he said when asked what the message for Zimbabwe is.
It is the third time that power has shifted peacefully from a ruling party to the opposition since the southern African country's independence from Britain in 1964.
There was a huge turnout of mostly young people, some who came dressed in their academic robes to protest lack of employment post graduation.
Joseph Kalimbwe, a youth representative of Hichilema's UPND party told CNN.
"Young people gave us the vote. Four million young people between the ages of 18 to 24 registered to vote. It was a huge turnout and it was very personal to them. They want to ensure the mistakes of their parents were corrected. They have voted for our leader on basis he has better policies and ideas and can strengthen our state institutions."