HERMOSILLO, Mexico — When Claudia Pavlovich ran for governor of Sonora, a vast swath of cowboy country south of Arizona, not a single Mexican state was led by a woman. Fewer than 10 percent of the nation’s mayors were female. And the hot issue of that 2015 campaign wasn’t Pavlovich’s political platform. It was her lack of wrinkles.

“Yes, I’ve used Botox,” the veteran politician declared to a news conference, addressing the swarm of memes about her looks. Turning the tables on her opponents, she created a winning slogan in this corruption-plagued state. “Using Botox isn’t a crime,” she told voters. “Stealing money is.”

As Pavlovich finishes her term this month, Mexico is celebrating an unlikely success. In the six years since that misogyny-plagued campaign, the number of female candidates for state and federal offices has soared. A country steeped in machismo is emerging as one of the world’s leaders in gender parity — and far outpacing the United States.

For the first time, 50 percent of lawmakers in Mexico’s lower house of Congress are women. (That compares with 27 percent in the U.S. House of Representatives.) Women are set to lead nearly a quarter of Mexico’s 32 states, after historic gains in the June midterm elections. In several states, including Sonora, women will outnumber men in local legislatures.

The shift is remarkable in a country where women didn’t win the right to vote for president until 1953. It underscores the power of gender quotas, which are increasingly popular in legislatures worldwide. Thanks to an ambitious 2019 constitutional reform, Mexico is seeking “parity in everything” — giving women an equal shot at top jobs in the legislative, judicial and executive branches.

“No country in Latin America has gone quite as far,” said Jennifer M. Piscopo, a political scientist at Occidental College in Los Angeles who studies gender in the region. “I’m fairly positive there’s also no other country in the globe that has written ‘parity in everything’ into their constitution.”

It’s still unclear how much such parity will translate into real power. In Mexico’s newly elected lower house, the Chamber of Deputies, men still lead the parties. And the increasing number of female politicians hasn’t necessarily meant improvement in women’s lives. Violence against women has surged in recent years, prompting an explosion of protests.

Yet many believe a years-long campaign for more equality is fundamentally changing Mexico. This week, the country’s supreme court effectively decriminalized abortion, a key demand of women’s groups. Affirmative action in government has become widely accepted; not a single lawmaker voted against the 2019 gender-parity reform. The inauguration of six female governors this month is seen as particularly significant because the posts are so powerful.

“This election marked a before and after,” said Josefina Vázquez Mota, a senator who broke gender barriers when she became the first female presidential candidate for a major party, in 2012. “From this election onward, the way of doing politics will change.”

Mexico hardly seemed destined for such a pioneering role. For most of its history, women have been second-class citizens, their roles shaped by the nation’s Spanish colonial heritage. Women left their homes to fight as “soldaderas,” or female soldiers, in the Mexican Revolution. But when the conflict wound down in 1920, so did their activism.

“Women are in this world to care for the home and not to get involved in politics,” a revolutionary veteran, Col. Crescencio Treviño Adame, wrote to then-President Lázaro Cárdenas in 1938. Giving female citizens the vote, he added, “would be madness.”

In 1964, two women reached the Mexican Senate. One was Pavlovich’s mother, Alicia Arellano, a dentist so determined to enter politics that she had flagged down then-President Adolfo Ruiz Cortines on a Mexico City street a decade earlier to ask for his support. She encouraged her daughter to pursue elected office. “There are things they’ll say to you because you’re a woman,” the senator said, according to Pavlovich. “But concentrate on your work, and leave the rest aside.”

By the 1990s, though, women still made up only about 15 percent of Mexico’s National Congress. In 2012, the then-ruling National Action Party made history by choosing Vázquez Mota, an economist, as its presidential candidate. Yet at a campaign event one night with business leaders, she recalled, their first question was why she wasn’t wearing her wedding ring.

“I was like, ‘Does someone have a question about international trade, or national security or tourism?’” she said.

She finished in third place.

Nonetheless, a quiet revolution was underway. As Mexico transitioned from a one-party system to democracy, it repeatedly rewrote its electoral laws. Women insisted that democracy meant an equal right to political representation. “They won the rhetorical argument,” said Piscopo. The quota for female congressional candidates was set at 30 percent, then 40, then 50.

Pushing for such reforms was a broad alliance of female politicians, activists, lawyers and academics. “We did pacts, strategies, how to vote, what would happen, how each would convince her party,” said Patricia Mercado, a senator who was a leader in the effort.

New, independent bodies such as the National Electoral Institute enforced gender-parity laws. “The political parties couldn’t say no,” said Mercado. “It wasn’t politically correct.”

Still, old-time power brokers tried to maneuver around the laws. They sometimes ran female candidates in their parties’ weakest districts, reserving their strongholds for men. Women’s groups sued to close such loopholes.

This year’s midterm elections illustrated the clout of the accumulated reforms. Women initially appeared to win 248 of the 500 races in the Chamber of Deputies, a pickup of seven seats. Women’s groups appealed, insisting that female candidates weren’t prominent enough on some parties’ proportional-representation lists. Mexico’s electoral court agreed.

Last week, when the Chamber of Deputies opened its new term, women held half the seats.

The parity measure requires ambitious changes in coming years. While lawmakers are still hashing out the details, future Mexican presidents and governors will probably have to name women to lead half of government ministries. Judicial authorities are aiming to roughly triple the number of female district judges and circuit court magistrates, and have started holding women-only exam sessions for the positions. (Mexico doesn’t rely on political appointments to the bench the way the United States does.)

Parties had to nominate women as half their candidates in the 15 governors’ races this year. They won six, a stunning result, given that only nine women had ever been governors in Mexico.

Yet despite all the change, machismo still infuses politics.

Women’s groups were outraged when President Andrés Manuel López Obrador’s party, Morena, nominated a politician accused of rape to be governor of Guerrero state this year. The politician, Félix Salgado Macedonio, denied the allegations. He was eventually disqualified because of alleged campaign finance violations.

The president has further alienated feminists with his cool response to protests against Mexico’s stunning levels of violence against women. López Obrador has defended his record on women’s issues, noting he was the first president to name a cabinet that was half female.

Even feminists debate how much women are benefiting from the growing ranks of female politicians. Women remain underrepresented in many areas, such as the economy and security forces. “We have gained positions but not power,” Mercado said.

Still, she maintained that female lawmakers have made changes where they can, such as passing a 2019 law that established labor protections for domestic workers.

Pavlovich, who belongs to the Institutional Revolutionary Party, hopes her example — raising three daughters while serving as governor, senator and state representative — will encourage women who have been reluctant to run for office. “People think you can’t have a family life when you are in politics,” she said. “That’s not true.”

But she’s had a rocky relationship with feminist groups, particularly over an upsurge in violence. Pavlovich petitioned the federal government in June to approve a gender violence alert for the state. Women’s organizations had been pushing for such aggressive action for years, said Maria Elena Carrera, a sociologist and activist in Sonora.

“She didn’t recognize the problem,” Carrera said. (Pavlovich says that Sonora has created special judicial offices and other programs to handle violence against women.)

Although women in Mexico are closer to gender parity, some think female politicians in the United States have more influence. Carrera said recent developments north of the border have offered fresh hope to Mexican women.

“We are all watching Kamala,” she said.

Alejandra Ibarra Chaoul in Mexico City contributed to this report.

Read more: