In 2019, at age 23, she was elected to the St. Louis Park city council, becoming its youngest-ever and first Muslim member. On November 7, 2023, Mohamed defeated retired banker Dale A. Anderson in the municipal election to succeed outgoing Mayor Jake Spano. Endorsed by Spano, she won 58% of the vote. The Star Tribune described her 2023 mayoral campaign as focused on investment in community policing and programs to make homeownership more affordable.