Judge Anisa Rasooli, pictured in her office in Kabul, was nine parliamentary votes short of becoming the nation’s first female Supreme Court justice. (Sudarsan Raghavan/The Washington Post)

The day is still etched in the Afghan judge’s mind more than a decade later — when she was in Washington, when she met with Supreme Court justices Sandra Day O’Connor and Ruth Bader Ginsburg. She recalls feeling awed and barely present, her thoughts instead flittering back to her country.

“I was asking myself whether we would ever have a similar situation in Afghanistan,“ said Anisa Rasooli, “where a woman judge would become a member of the Supreme Court.”

Last month, Rasooli came close — only to be let down by other women.

Afghanistan’s U.S.-educated president, Ashraf Ghani, had nominated Rasooli to become the country’s first female Supreme Court justice, carrying out an election promise. It was a landmark choice in a country where only 14 years ago, the Taliban Islamist regime bannedwomen from work, education and other parts of public life. They were forbidden from even leaving their homes without a male relative and a head-to-toe burqa.

Activists here and abroad were ecstatic. A woman on the bench of the country’s highest court could be an antidote to a growing concern: the erosion of gains in women’s rights as the Western military and aid footprint shrinks.

But then Afghanistan’s conservative establishment asserted itself. Influential Islamic clerics, as well as some male lawmakers, declared that a woman was not fit to try serious criminal cases. Their protests illustrated a continuing struggle pitting age-old traditions and customs against efforts to shape Afghanistan into a modern society.

Still, there were 69 female members in the Afghan parliament, which had to ratify Rasooli’s appointment, providing good odds for her to make history. But when the body met to vote this month, 23 female lawmakers were absent. Of 184 lawmakers present, 88 voted for her in the secret ballot — nine too few.

“If the women were there, and if they had voted for me, I would have won,” said Rasooli, who is 47 and unmarried.

On a recent day, Rasooli, wearing black rectangular glasses and a pink headscarf, sat at her large desk, which was piled with files. She was back at work as the head of the juvenile appeals court. A male assistant walked in and handed her another case to read. He nodded in respect and left.

Rasooli expressed no bitterness over the vote — only disappointment. She had been working toward this since the day she graduated with a law degree from Kabul University. A strong student, she said she turned down offers to become a lecturer and an adviser to the Commerce Ministry.

“I always wanted to become a judge,” Rasooli explained.

After graduation, that drive took her through positions in various judicial offices during the communist-ruled era. When that regime fell, she became a judge on the penal court. Later, she earned a master’s degree in law and took human rights seminars, as well as trips to India, the Philippines and the United States, where she met President George W. Bush. She lectured at Kabul University and was a founding member of the Afghan Women Judges Association, which she heads.

She built a reputation for honesty in a judicial system widely viewed as corrupt. She doesn’t own a house — she can’t afford one on her salary — while other judges and officials own mansions and luxury cars.

“She’s the cleanest judge,” said Farida Frahmand, a friend and classmate who used to work with Rasooli in the juvenile courts and was visiting her this day from Albuquerque. “Everybody knows that.”

All this is to say that Rasooli was, perhaps, the most qualified judge to join the Supreme Court.

But she is a woman.

“There are various reasons why a woman can’t be a judge from sharia point of view,” said Sayed Mohammad Musa Jinab, a lawmaker from Badghis province who was absent for the vote. “The main one is that by nature a woman has a tender heart, and a woman judge would use leniency while giving a ruling over a punishment that deserves severe punishment.”

Qazi Nazir Ahmad Hanafi, a lawmaker from Herat who voted against Rasooli’s nomination, agreed. Female judges, he said, “can’t stand supporting executions, chopping of hands and legs, as stipulated in the constitution for crimes.”

Ghani did not publicly comment on the rejection of his nominee, but his aides say he was not happy. They said religious scholars had assured him that a woman had every right to become a Supreme Court justice.

“She was qualified, she was educated, she was fit for the position,” said Sayed Zafar Hashemi, a Ghani spokesman. “The president is committed to having more substantial women’s voices in the Afghan state, its judiciary and other branches of government. There was no legal or religious obstacle for her to serve in the Supreme Court.”

Ahmad Behzad did what most of his male colleagues in parliament did not: He voted for Rasooli.

“The presence of a woman in such an important government organ is a must,” Behzad said. “Only a woman can feel and understand another woman. She will be in a much better position to deal with women and family-related issues.”

Some female lawmakers said male colleagues persuaded them to vote against Rasooli because they argued it was against Islamic law. Some lawmakers, male and female, voted no because they are politically opposed to Ghani. A few were upset that Rasooli didn’t lobby them hard for their vote, while others found her too pedagogic.

What saddens Rasooli the most are the female lawmakers who were absent, she said.

“I don’t know if they had any justification for their absence that day or whether they were dictated or ordered not to show up,” she said.

It was likely a bit of both.

Bibi Hamida Yousufi, a lawmaker from Kandahar, was among the women absent. She learned about the vote only 12 hours before, she said. Flights were full, and traveling by road to Kabul was too dangerous. Another female member of parliament, she added, couldn’t vote because her mother was ill. Yousufi said she regrets not being there.

“She was the right candidate,” she said.

After Rasooli’s rejection, women’s rights activists, diplomats and officials expressed disappointment.

“This week Afghan parliament had a historic opportunity to approve a qualified female judge as a member of the Supreme Court high council,” Deborah Lyons, the Canadian ambassador, tweeted in Dari, one of the country’s languages. “Why didn’t it happen?”

Rasooli said she knows the answer. But she’s faced obstacles before. When the Taliban seized power in 1996, they fired all female judges. Rasooli returned to her village in Parwan province and started a girls school that operated secretly. The school is still operating, now under government control.

Some graduates, Rasooli said, have “become good lawyers and judges.”

Now Rasooli and other women’s rights activists are lobbying Ghani to nominate another woman to the Supreme Court. They say Rasooli’s loss by such a small margin has given them hope that next time they will succeed.

“I will not give up the fight,” Rasooli said. “A legitimate fight is the most righteous thing you can do in your life.”

Sayed Salahuddin in Kabul contributed to this report.

Read more:

In 2004, I met an Afghan girl sold into an abusive marriage at age 9. This month, I set out to find her.

After suffering under the Taliban, an Afghan minority faces new threats

Fear of the Islamic State spawns a renegade Afghan militia