MONROVIA, Liberia — Bernice Freeman was chatting with some market women, trying to explain why it was so important that they leave their food stalls to vote for the first woman to be elected president of an African country, when she noticed some boys laughing nearby, waving something white.

It was October 2005, the first presidential election after 15 years of a hideous civil war in Liberia. On the ballot was Ellen Johnson Sirleaf, a Harvard-educated global technocrat with so much government experience it practically oozed from her pores, and a group of men, most notably the professional soccer player George Weah.

Like many of the 1.5 million women in Liberia who had survived the civil war, Ms. Freeman had personally witnessed acts of violence so brutal she still had nightmares. Soldiers had gutted her 8½-months-pregnant cousin. Drugged-up rebels wearing Halloween masks had murdered her friends. Ms. Freeman herself had knelt in the dirt, praying, while henchmen loyal to the president had chambered rounds of their machine guns on orders to shoot her and the other women praying with her one afternoon.

Ms. Freeman had seen it all. But even so, she was unprepared for the sight of the young men laughing nearby as she campaigned for a female president. The boys had taken women’s panties, had smeared the crotches with tomato paste and were waving them at the women — their unsubtle way of saying that a woman could not be president.

But instead of making Ms. Freeman and the other women embarrassed, the heckling only angered them.

“You know what?” one of the undecided women told Ms. Freeman, looking at the boys in disgust. “We will vote. Don’t worry, we will vote.”

And vote they did. Close to 80 percent of the Liberian women who flooded the polls during the country’s first postwar presidential election voted to usher a woman into power for the first time on a continent that for centuries had been the world’s most patriarchal.

Eleven years before Pantsuit Nation became a secret Facebook group for women who supported Hillary Clinton in America and “I’m With Her” buttons and bumper stickers sprouted on lapels and S.U.V.s, the women of Liberia held a master class in how to get a woman elected president. Now, as the American women who supported Mrs. Clinton grapple with the whys of last November’s election, the story of how, 4,500 miles away, the women of Liberia upended centuries of male rule to accomplish what their American counterparts could not has acquired a sharp and keen relevance.

Imagining an Alternative

The Liberia story is one of extremes. It is almost as if for Liberians to contemplate installing a woman as president, the country needed to first go over a cliff so steep that there seemed nowhere left to drop. Mothers saw their children kidnapped, drugged and forced to take up arms in the country’s never-ending civil war. More than 70 percent of Liberian women were raped during the war years. Starving young girls gnawed on tree bark for sustenance, while horrified children were forced to watch their sisters, mothers and grandmothers gang-raped in front of them.

What happened in the war years so devastated Liberian women, who blamed the men who waged the war for the ensuing horrors, that many of them came to view Mrs. Sirleaf not necessarily as the better of the presidential candidates but, rather, as the only alternative to putting a man back in power in a place that men had just run into the ground.

Masawa Jabateh, who had seen her 3-year-old daughter die from malnourishment during the war, said her despair became infused with a blind fury when she saw men campaigning to be president in 2005, especially since the leading candidate was Mr. Weah. “Those men want put some grona boy in the chair who don’t know what we doing? So we can go back to war again? No,” she said.

Her thought process was straightforward: She was “voting for woman,” she said.

“Vote for Woman,” in 2005, became the de facto campaign slogan of Ms. Sirleaf’s run for the presidency. It all started on the morning of May 2, 2005, a week into the voter registration period for the looming presidential elections, when Vabah Gayflor, the minister for gender, woke up to discover that women had not been registering to vote.

A string of men were tossing their hats into the ring for the presidency, including Mr. Weah, a renowned athlete who had won the Ballon d’Or and been named FIFA world player of the year and African player of the century.

Unlike his rivals, Mr. Weah was not tainted by any association with those who had brought Liberia to ruin over the past 15 years, but he had no college education. (His listing of a bachelor’s degree in sports management from Parkwood University in London was a subject of a scandal after news accounts surfaced calling the school an unaccredited diploma mill requiring no actual study.)

At the other end of the spectrum was Mrs. Sirleaf. A former finance minister and jailed dissident, she had a pedigree that included the United Nations, the World Bank and the International Monetary Fund. She had transformed herself from an abused wife, cowering and hunched in the front seat of her husband’s car while he slapped her, to an international bureaucrat attempting what no woman had ever done before: winning, by popular vote, the right to lead an African country.

To the Weah supporters, there was no contest. Grandmother versus soccer star? But to women like Ms. Gayflor, Ms. Jabateh and Ms. Freeman, there was also no contest. “You will take our country, our baby, and throw the baby away to football player? I beg you, no,” Ms. Gayflor said.

Ms. Gayflor’s job as gender minister was supposed to be about helping women and children get access to health care, school feeding programs (in a postwar country with hardly any schools) and rape support.

But she decided to redefine her role: getting a woman elected president. And she was not happy with the news from the National Elections Commission: Of the 100,000 Liberians who had registered to vote in the first week of the monthlong registration drive, only 15 percent were women.

Who was registering instead? Former combatants, from all the armed groups that had fought in the war. Ms. Gayflor was appalled.

Getting Women to Vote

Huddling with Etweda Cooper, the women’s activist known throughout Liberia as “Sugars,” Ms. Gayflor knew they had to take action fast.

The men were holding mass rallies. But market women didn’t have time to go to mass rallies. They were busy making market. Ms. Gayflor and Mrs. Cooper realized they would have to try a different strategy.

Quickly they organized a group to use the radio stations to plead: “Women, oh women! Y’all got to register to vote.” They fanned out to the Monrovia markets.

At first, some of the market women balked; they had their wares and their babies to tend. But Mrs. Cooper was ready for them with babysitters and stall tenders. “We will mind it for you,” she said. “Go register.”

It was not enough to stay in Monrovia. The Liberian bush loomed, large, imposing and filled with village women. The women bought bullhorns and scattered their troops along the road. “Women, oh women!” they yelled into the bullhorns. “Go register.”

By the end of the registration period, the final figures came out: Some 1.5 million Liberians out of the country’s population of three million had registered to vote.

Fifty-one percent of those registered were women.

Unlike American presidential campaigns, the Liberian campaign season begins two months before Election Day. Liberian election rules dictate that a winning candidate has to get 50 percent of the vote — a quirk that guaranteed that in a crowded field of 22 candidates, there would be a runoff. So the key for Mrs. Sirleaf was to survive the first round by coming in second at least, so that she would then stand alone against Mr. Weah.

As a government minister, Ms. Gayflor was not allowed to show favoritism for any candidate, let alone campaign on one’s behalf. So she and Mrs. Cooper devised a strategy: They would present their efforts as simply an attempt to empower women. Ms. Gayflor would not sully her cabinet position by telling women whom to support. (She left that to Mrs. Cooper.) Instead, she would simply encourage women to exercise their right. She organized women’s rallies where she gave speeches exhorting the crowd to vote.

“I’m not telling you who to vote for, women!” she said. “Just make sure you vote.”

Right after Ms. Gayflor spoke, Mrs. Cooper — not constrained by any neutrality vows — shouted at the crowd, “Vote for woman!”

Image

A billboard in support of George Weah, a soccer player who became Mrs. Sirleaf’s chief opponent in the 2005 race.CreditIssouf Sanogo/Agence France-Presse — Getty Images

At the rallies, the women passed out plastic bags of drinking water, a rare and precious commodity in a place where people regularly drank from unsanitary wells and dirty rivers.

Making History

The rainy season was ending, but the air was still stewy when Election Day dawned. Of the 1.5 million people registered to vote, some 900,000 showed up at the polls. They came in wheelbarrows and wheelchairs. They came with babies on their backs. They came the night before, some sleeping on the hard ground outside the polling booths so they could vote when morning came.

The results began to trickle in that night. As expected, Mr. Weah was in first place. But he wasn’t close to 50 percent. And Mrs. Sirleaf was right behind him, where she needed to be.

Time for the real battle. The soccer player versus the 67-year-old grandmother.

The men fell in line behind Mr. Weah and complained that the women supporting Mrs. Sirleaf were sexist. Given the choice between a soccer player with no credible college education and a Harvard-educated development expert, the top male presidential candidates who fell short of the runoff, with one exception, endorsed the soccer player.

In the meantime, Mr. Weah, honing a message explaining why he, and not Mrs. Sirleaf, should run Liberia, settled on an “educated people failed” theme.

But what the men who endorsed that strategy failed to realize was how much that very idea was angering the market women. Those women may not have been educated themselves, but they worked in the fields and the market stalls to send their children to school. Now the men were telling them that education wasn’t important. Just as the men fell in behind Mr. Weah, the women fell in behind Mrs. Sirleaf.

The market women went door to door, passing out T-shirts and fliers. They slept on the side of the road at night, curled up on their mats. They walked from village to village, calling out the now familiar mantra “Vote for woman!”

Mr. Weah’s supporters responded by promising that if he lost, the country would go back to war. “No Weah, no peace!” they chanted.

Thus the runoff started resembling past elections, like the one in 1985, in which Samuel Doe’s supporters had suggested the same thing: Vote for Mr. Doe or the country goes back to war.

Except that in November 2005, this tactic appeared to have met its match. Because the women had their own tricks, tricks that would make Mr. Weah’s threats look like boys’ play.

A group of women had stationed themselves at a bar near a major intersection, luring young men in a time-honored fashion. Except this time the women were the ones with the cash, and the young men were the ones with the commodity for sale.

Image

Women waiting to cast their ballots in the election. Some who arrived at this school, in Bopolu, said they had come at 3 a.m. to ensure they would be able to vote.CreditMichael Kamber for The New York Times

“Some of those boys were finish stupid,” a market woman, Nancy Nagbe, recalled with a smirk. “We were crafty, oh!”

Many of the young men thought they were done with voting after the first round and didn’t understand that they would need their IDs again. Others knew and did not care; late in the evening of a muggy hot day, the lure of a crisp, cold and malty Club Beer far outshone whatever benefits they thought their voter card could bring them.

As for the ones who were too smart to sell their voter card — their mothers simply stole them, recalled one gender ministry official, Parleh Harris.

One market woman said she sneaked into her son’s room while he was sleeping, slipped his voter ID out of his wallet and buried it in the yard.

“Yeah, I took it. And so what?” the woman said. “That foolish boy, what he knew? I carried him for nine months. I took care of him. I fed him when he was hungry. Then he will take people country and give it away?”

Ms. Gayflor, by now, was sailing perilously close to getting fired for illegally campaigning as a government minister. A few days before the runoff, she called a meeting in a room at the gender ministry. She invited every female political candidate, no matter what party she belonged to, along with market women, female lawyers and anyone else she could think of who lacked a Y chromosome.

That night, in the stuffy room, the women all stood, one by one, and pledged to support Mrs. Sirleaf, who was so overcome afterward she could barely stand upright. “If I were a crying woman,” she said, “I would be crying right now. You have humbled me.”

The repercussions came the next day. Ms. Gayflor arrived at work to find reporters camped out on the ministry’s steps. The questions came furiously.

Ms. Gayflor was past the point of backing down. “You take a former football player and give him our country?” she shot back. “Liberia is not a learning ground!”

She had one last shot to fire. “Let me give you a goodbye statement,” the soon-to-be-former minister said. “Mrs. Sirleaf will be the next president of this country.”

On Tuesday, Nov. 8, 2005, the people of Liberia went to the polls for the second time in four weeks. There was a palpable sense in the air that something big was happening. International observers stationed themselves at polling places and voting booths; some 230 agencies, from the Carter Center to the European Union, showed up to chronicle the proceedings. Helicopters from the United Nations mission hovered overhead, a constant presence above the voting booth lines.

But the helicopters could not see what was going on at a polling station in Sinkor. Helpful poll workers were allowing pregnant women and nursing mothers to cut to the front of the line. So Ms. Freeman — who had been heckled weeks before by the young men waving white panties smeared with tomato paste — and a handful of other women were passing around babies and toddlers.

“You want borrow the baby?” Ms. Freeman grinned at one woman, sneaking a furtive look over her shoulder. “Put the baby on your back.” To another woman, she advised: “Act pregnant. If they think you pregnant you can vote in front.”

It was unclear whether the poll workers noticed how many different women were carrying the same baby to vote on that Election Day in November 2005.

And when the National Elections Commission, on Nov. 23, announced the election results — Mrs. Sirleaf’s 59.4 percent to Mr. Weah’s 40.6 percent — Ms. Freeman wore a smile on her face.

Helene Cooper, the Pentagon correspondent for The New York Times, grew up in Liberia before emigrating to the United States in 1980. This article is adapted from her forthcoming book, “Madame President: The Extraordinary Journey of Ellen Johnson Sirleaf,” to be published on Tuesday.

A version of this article appears in print on , on Page A8 of the New York edition with the headline: How Women Delivered Africa’s First Female President. Order Reprints | Today’s Paper | Subscribe