ACCRA, Ghana — Kofi Annan’s fellow Ghanaians finally got their moment to bid farewell to the Nobel laureate on Thursday, in an elaborate state funeral for the first black African to ever lead the United Nations.

Nearly four weeks after Mr. Annan died suddenly at age 80, thousands gathered in the capital, Accra, a mix of chiefs in traditional dress gathered under ceremonial umbrellas alongside clerics, diplomats, politicians and family members.

“My love, you are now back home where you started your long journey,” Nane Annan, Mr. Annan’s widow, told the crowd. She said that her husband had “challenged us all to work for a better world right where we are.”