Nigerian acting President Goodluck Jonathan has been sworn in as Nigeria’s new president, hours after President Umaru Yar’Adua died following a long illness.

Mr. Jonathan took the oath of office Thursday morning in a televised ceremony at the presidential palace.

In a brief address, he pledged to fight corruption, to work for fair elections, and to work to move towards peace in the Niger Delta.

Mr. Jonathan also praised Mr. Yar’Adua as a man of great integrity and outstanding humility.

Mr. Yar’Adua died late Wednesday at the presidential villa. He was 58.

Officials have not announced the cause of death. But Mr. Yar’Adua had been incapacitated since late November, when he was flown to Saudi Arabia for what officials said was inflammation of the membrane around his heart.

His absence led to a political crisis that culminated in February, when Nigeria’s parliament named Mr. Jonathan, then the vice president, as the country’s acting leader.

Mr. Yar’Adua returned to Nigeria soon after, but had not been seen in public since then.

The presidency Thursday announced seven days of national mourning and said Mr. Yar’Adua would be buried later in the day.