Claudia Sheinbaum, a Jewish scientist, environmentalist and left-wing politician, became the first woman ever to be elected Mexico City mayor on Sunday, according to exit polls.

Sheinbaum, 56, has made a rapid political rise to lead North America's largest city -- though it has not been without controversy.

She won the election to lead the capital with between 47.5 and 55.5 percent of the vote, according to the polling firm Mitofsky.

She will not be the first woman to govern Mexico City -- Rosario Robles held the job on an interim basis from 1999 to 2000, after her boss, Cuauhtemoc Cardenas, resigned to run for president.

But it is a historic electoral win in a country with deep-rooted problems of gender inequality and violence against women.

Sheinbaum surged into office on the coattails of the anti-establishment leftist who looks likely to win the presidential race, Andres Manuel Lopez Obrador.

She was among the first politicians to leave Mexico's established left-wing party, the Party of the Democratic Revolution (PRD), and join Lopez Obrador's breakaway, Morena, when he formally launched it in 2014.

The following year, she won election as district mayor of Mexico City's Tlalpan neighborhood, Lopez Obrador's own district and one of the 16 "delegations" that make up the sprawling capital of more than nine million people.

That was the launch pad for her mayoral campaign -- but she has been embroiled in controversy along the way.

Tlalpan was one of the areas hardest hit when a 7.1-magnitude earthquake devastated central Mexico on September 19, 2017.

Sheinbaum's district became the center of world attention when the Rebsamen elementary school collapsed in the quake, killing 19 children and seven adults inside.

It later emerged the district had granted dodgy construction permits to the private school's owner -- who is today on the run from the law -- allowing her to build an apartment for herself on top of the building, which destabilized the structure.

A group of victims' families has brought criminal charges over the case, and wants Sheinbaum to face investigation.

She vehemently denies responsibility, and accuses her opponents of exploiting the tragedy for political reasons.

But she has been the target of unrelenting anger from victims' families and their sympathizers -- including on election day.

"Murderer!" a protester shouted at her after she cast her ballot.

- Activist origins -

Born into a family of scientists, Sheinbaum studied physics at the National Autonomous University of Mexico, earning a doctorate in energy engineering and going on to work as a consultant for the United Nations.

She was active in the university's student movement, which rose up against an unpopular series of reforms at the institution in 1986.

She was one of many veterans of the movement to go into politics and help launch the PRD in 1989 -- the main opposition party in what was then a one-party state.

She married fellow student activist Carlos Imaz in 1987.

Imaz was among the most recognizable faces of the Mexican left, also governing the Tlalpan district, until in 2004, he was one of several top officials caught on camera accepting large sums of cash.

He avoided jail time, but resigned and faded from politics. The couple separated in 2016. They have a daughter.

When Lopez Obrador was elected Mexico City mayor in 2000, he named Sheinbaum his environment minister.

She followed the fiery leader when he split with the PRD to found Morena, and is seen as a close ally, winning the party's mayoral nomination in August over the man who was considered the favorite, veteran politician Ricardo Monreal.