Mugabe (84) was one of a dozen state and government heads attending the Somhlolo Stadium celebrations amid tight security. He raised his fist in acknowledgement of the welcome, clearly delighted.
The celebrations went ahead amid heavy criticism in Southern Africa that they ignored the plight of the poor, and tight security was ordered.
About 2 000 people took to the streets of Mbabane on Thursday to protest against the spending on the party, and the absence of political freedom.
Swaziland, a country of about one million people, mostly subsistence farmers, is the world’s last absolute monarchy.
The "40-40" celebrations were being held to mark the 40th anniversary of Swazi independence from Britain along with Mswati’s 40th birthday.
Rwandan President Paul Kagame, Lesotho’s King Pakalitha Mosisili and United States assistant secretary for African affairs Jendayi Frazer were among guests, as were the presidents of Madagascar, Uganda, Namibia, Botswana, Mozambique and Malawi.
The government said the party would cost 20-million emalangeni ($12,6-million), but critics estimated it would cost several times that.
The controversy comes against the backdrop of rising tensions in the normally peaceful kingdom in advance of legislative elections on September 19.
Mswati, who is famous internationally for having 13 wives, has reigned over the landlocked kingdom for 22 years.
His spending on the party, which includes 20 new BMW 7 series cars and 120 cattle, has angered many in the country where about 70% of people live on less than a dollar a day and one in four adults is HIV-positive. — Sapa-dpa