Lagos, Nigeria (CNN) -- Nigeria's acting president took the oath of office Thursday morning, hours after Africa's most populous nation woke up to news its elected leader Umaru Yar'Adua had died after a long illness.
Goodluck Jonathan will serve as president until the next election, expected to held next year.
President Yar'Adua died Wednesday after battling a heart ailment that had kept him out of the public eye since November. A state funeral will be held in his native Katsina, followed by seven days of national mourning.
The 58-year-old leader went to Saudi Arabia for treatment in November, creating a power vacuum in the West African nation. He was treated for an inflammation of tissue around his heart and returned to Nigeria in February.
However, he remained out of sight, and Jonathan has served as the country's acting leader since his return.
Yar'Adua took office in 2007 in an election mired in controversy and accusations of vote-rigging.
"There was ballot snatching, voters were molested, voters were beaten ... and also payment inducement to vote for certain candidates," said Eneruvie Enakoko of the Civil Liberties Organization, a human rights group in Lagos.
Despite the accusations, the president -- a soft-spoken and unassuming figure who did not bask in the media spotlight like past leaders of the West African nation -- pledged to fight to improve the country of 150 million people.
"Our collective goal is to deliver for our children a Nigeria better, stronger, more peaceful, more secure and more prosperous than we met it," Yar'Adua said.
U.S. President Barack Obama and U.N. chief Ban Ki-moon expressed their condolences over Yar'Adua's death.
They applauded his quest for stability, especially in Nigeria's oil-rich Niger Delta, where he offered amnesty to rebels battling government forces.
"He will be remembered, among other things, for his efforts to bring peace and stability to the Niger Delta region and for his commitment to democratic governance and electoral reforms," Ban said in a statement.
Obama praised his efforts "to promote peace and stability in Africa through his support of Nigerian peacekeeping efforts as well as his strong criticism of undemocratic actions in the region."
One of Yar'Adua's biggest successes was offering amnesty to militants in the troubled oil-rich Niger Delta region, a move that brought fragile peace to the area after years of conflict. The well-armed Niger Delta rebels have been battling Nigeria's armed forces over oil profits, which they say are unequally distributed.
While he has hospitalized in Saudi Arabia, the militants called off the truce, dealing a blow to plans to end violence that has crippled oil production in the nation.
CNN's Faith Karimi and Christian Purefoy contributed to this report.