Mamdani, a Democrat, was sworn in at a decommissioned subway station below City Hall, placing his hand on a Koran as he took his oath as the city's first Muslim mayor.
After working part of the night in his new office, Mamdani then returned to City Hall for a grander public inauguration where Senator Bernie Sanders, one of the mayor's political heroes, administered the oath for a second time.
"Beginning today, we will govern expansively and audaciously. We may not always succeed, but never will we be accused of lacking the courage to try," Mamdani told a cheering crowd.
"To those who insist that the era of big government is over, hear me when I say this: No longer will City Hall hesitate to use its power to improve New Yorkers' lives," he said.
Throngs turned out in the frigid cold for an inauguration viewing party just south of City Hall on a stretch of Broadway known as the "Canyon of Heroes," famous for its ticker-tape parades.
Throughout the ceremony, speakers hit on the theme that carried Mamdani to victory in the election: Devotion to using government power to lift up the millions of people who struggle with the city's high cost of living.
Sanders insisted that doing so - partly by raising taxes on the rich - wouldn't be radical.
"In the richest country in the history of the world, making sure that people can live in affordable housing is not radical," he told the crowd. "It is the right and decent thing to do."
Mamdani was accompanied on the stage by his wife, Rama Duwaji. The previous mayor, Eric Adams, was in attendance, sitting near another former mayor, Bill de Blasio.
In addition to being the city's first Muslim mayor, Mamdani is also its first of South Asian descent and the first to be born in Africa. At 34, Mamdani is also the city's youngest mayor in generations.
In a campaign that helped make "affordability" a buzzword across the political spectrum, the democratic socialist promised to bring transformative change with policies intended to lower the cost of living in one of the world's most expensive cities. His platform included free child care, free buses, a rent freeze for about one million households, and a pilot of city-run grocery stores.
But he will also have to face other responsibilities: handling garbage and snow and rats, while getting blamed for subway delays and potholes.
Mamdani was born in Kampala, Uganda, the son of filmmaker Mira Nair and Mahmood Mamdani, an academic and author. His family moved to New York City when he was seven, with Mamdani growing up in a post-9/11 city where Muslims didn't always feel welcome. He became an American citizen in 2018.
He worked on political campaigns for Democratic candidates in the city before he sought public office himself, winning a state Assembly seat in 2020 to represent a section of Queens.
Mamdani inherits a city on the upswing, after years of slow recovery from the COVID-19 pandemic. Violent crime has dropped to pre-pandemic lows. Tourists are back. Unemployment, which soared during the pandemic years, is also back to pre-COVID levels.
Yet deep concerns remain about high prices and rising rents in the city.
with AP and DPA