The democratic socialist, who was born in Uganda, won on a grassroots campaign, promising a rent freeze, free buses, and universal childcare.
The early-morning ceremony took place in a historic former subway station beneath City Hall, with a public inauguration scheduled later on New Year's Day.
Mamdani, 34, faced racist and Islamophobic attacks during his campaign, as well as concerns from some Jewish New Yorkers regarding his past views on Palestinian solidarity.
His administration is expected to face challenges, including potential clashes with the Trump administration over immigration and questions about funding his extensive social services agenda.