Sumbul Siddiqui became the first Muslim mayor in the state on Monday, getting elected in Cambridge — where her family moved decades ago after emigrating from Pakistan.

Siddiqui, 31, was elected unanimously on the first ballot by her fellow councilors. Following the vote, the packed chamber stood and showered her with applause.

“The more and more different representation there is, the better it is for everyone,” she told the Herald after the inauguration, noting Cambridge’s diversity.

“It’s very important for people to see themselves in folks they elect,” she added.

Siddiqui, in her second term on the council, became Massachusetts’ first Muslim mayor, according to Jetpac Inc. — a nonprofit that works on getting American Muslims elected.

“Mayor Siddiqui is the first American Muslim Mayor in Massachusetts, and in her opening address has emphasized the importance of service and how it has been such a foundational part of her life since moving to America from Pakistan as a child,” Jetpac wrote on Facebook.

As a 2-year-old, Siddiqui moved with her parents and twin brother to the U.S. from Karachi, Pakistan. Her family won a lottery to enter Cambridge’s affordable housing system, which placed them in Rindge Towers in North Cambridge and then in Roosevelt Towers in East Cambridge.

As a Cambridge Rindge and Latin student, Siddiqui co-founded the Cambridge Youth Involvement Subcommittee, now the Cambridge Youth Council in its 15th year. She holds a bachelor’s degree from Brown University and a law degree from Northwestern Pritzker School of Law.

Between college and law school, Siddiqui served as an AmeriCorps fellow at New Profit, a Boston nonprofit that works on improving social mobility for children, families and their communities.

As mayor, her top priority will be “creating more affordable housing,” she told the Herald.