JUST BEFORE SHEleapt from her roof into the streets of Kabul, Farima thought of the wedding that would never happen and the man she would never marry. Her fiancé would be pleased to see her die, she later recalled thinking. It would offer relief to them both.

Farima, 17, had resisted her engagement to Zabiullah since it was ordained by her grandfather when she was 9. In post-Taliban Kabul, where she walked to school and dreamed of becoming a doctor, she still clawed against a fate dictated by ritual. After 11 years of Western intervention in Afghanistan, a woman’s right to study and work had long since been codified by the government. Modernity had crept into Afghanistan’s capital, Farima thought, but not far enough to save her from a forced marriage to a man she despised.

Farima’s father, Mohammed, was eating breakfast when he heard her body hit the dirt like a tiny explosion. He ran outside. His daughter’s torso was contorted. Her back was broken, but she was still alive.

In a quick burst of consciousness, Farima recognized that she had survived. It was God’s providence, she thought. It was a miracle she hadn’t prayed for. But it left her without an escape. Suddenly, she was a mangled version of herself, still desperate to avoid the marriage her family had ordered.

She didn’t know it yet, but her survival meant that she would become a test case in one of her country’s newest and most troubled experiments in modernity: a divorce court guided by Afghanistan’s version of Islamic sharia law. Could a disabled teenager navigate a legal system still stacked against women?

“We still must get married,” Zabiullah told his brother when he heard about Farima’s suicide attempt. “The engagement must remain.” Her father agreed that Farima’s pursuit of a separation was unwise. “We are not a liberal family,” Mohammed said. “This is not how we handle our problems.”

WHEN HER MARRIAGEwas fixed, a 9-year-old Farima crawled into her mother’s lap, confused about what it meant to be engaged. Even as Kabul grew more modern, that traditional engagement was unbreakable, her parents told her. The man she was destined to spend her life with was a distant cousin. If the marriage didn’t happen, the family could splinter.

But when Farima got to know Zabiullah, she couldn’t stand him. They talked on the phone, and he chastised her for venturing outside her home. He demanded that she stop speaking even with members of her family. “She was too close with her relatives, getting ice cream and going to the market with her father’s cousin,” he said.

“If he was like that when we were engaged, what would marriage have been like?” Farima said. “I couldn’t bear it.”

LESS THAN A minuteafter Farima hit the ground, Mohammed scooped up his daughter. He hailed a taxi, and they sped to Ali Ahmed Hospital, where Taher Jan Khalili performed surgery for three hours. The family was ashamed to tell Khalili the truth. Her father said Farima had fallen by accident.

“I wasn’t sure if she would survive. Her back was badly broken,” Khalili said. In the past year, he has handled nearly a dozen attempted female suicides. Farima spent nine days in the hospital, flickering in and out of consciousness. When she re-entered the world in late September, bandaged and carried on a stretcher, her relatives cried and thanked God that she had survived.

“But if not death, then what?” Farima thought.

Zabiullah, a plumber, was insistent that the wedding date remain unchanged. He had spent $30,000 on gifts for his fiancée, he said. He had paid for a big engagement party, during which Farima had sat sullen for hours, while relatives sang and danced and ate kebab.

“Everyone was having a great night, but she did not,” Mohammed said.

Dozens of women in Afghanistan kill themselves each year to escape failed, and often violent, marriages. Those tragedies are widely mourned, but they nonetheless offer a resolution recognized by Islamic law: A woman’s death, even by her own hand, marks the end of a marriage or engagement. Women who run away face prison sentences of several years.

A failed suicide is more complicated to untangle. When Farima awoke in the hospital bruised and broken, her wedding had not yet been canceled. Nearly all of her relatives expected her to follow through with the marriage. She gave up on the prospect of another suicide attempt; she could not walk without assistance and was too weak to inflict much damage on herself. The girl accused of being “too modern” would make another modern decision: She opted to resolve her failing engagement in Kabul’s nascent family court.

She would have to plead her case in front of a room full of judges and lawyers, who would decide whether she was entitled to a separation. In traditional Afghan culture, men can divorce their wives without the approval of any justice system.

Two months after she left the hospital, her mother and father helped carry her to the third floor of the family court—a faded yellow guesthouse, where a line of burqa-clad women are nearly always waiting outside. Farima wore a black headscarf. Her skin was pallid. She hadn’t been outside in weeks, spending most of her time reading novels in her room. The chief judge, Rahima Rasai, looked across the room at Farima while she adjusted her back brace.

“You have ruined your life,” Rasai said.

The court is a place where a woman is entitled to plead for divorce or custody of her children, but only if she has five male “witnesses,” or defenders, and often only if her husband or fiancé condones the separation. The court is funded by Western organizations but adheres strictly to sharia law.

Farima sat on the opposite side of the room from her fiancé. She looked at the judge and tried hard not to cry.

EVERY YEAR, KABUL'S family court handles about 300 cases, mostly women seeking to divorce their negligent or abusive husbands. Established in 2003, it was seen widely as a leap of progress after the Taliban’s stoning of adulterers and dismantling of women’s rights. Women whose fiancés emigrated from Afghanistan line up to seek separation from absent partners. Girls whose husbands sold them as prostitutes sink into the court’s cushioned chairs, begging for divorce certificates stamped with a government insignia.

Last month was a typical one at the court: Some women screamed at their husbands. Some brought their small children to testify. Some beat themselves with their fists to demonstrate the abuse they had endured. Some watched as their husbands were dragged out in handcuffs. Some arrived in burqas, and some in blue jeans. Many were crying as they left the courtroom.

On Farima’s day in court, her father sat in the corner of the room. For years, he had been trying to avoid this moment. “I told my daughter not to do this. We don’t want a bad name. We don’t want our family to fall apart,” Mohammed said.

Farima had told him many times that she was thinking about killing herself, he said. When he looked at her, crumpled and frail, he knew what he could have prevented.

“I just never thought she would really do it,” he said.

“What is wrong with this man?” Rasai asked Farima, pointing to Zabiullah.

“He treats me terribly,” Farima said. “Our marriage would be hell.”

Then the judge looked to Zabiullah. He wanted badly not to be there, objecting to the whole idea of a family court. “She is confused,” he said. “She has become so liberal,” he said.

There was a hush in the courtroom. Rasai sipped her tea. She was tired. It was the last case of the morning. Already, the court had heard four women pleading for divorce and protracted arguments over dowry compensation and physical abuse. None of those cases had been resolved. There weren’t enough male witnesses, or Rasai wasn’t convinced that a separation was warranted; she is reluctant to grant too many.

“It haunts me. Even when I’m praying, I think about the sadness of my job,” Rasai said later.

Although she is one of Afghanistan’s few female judges, Rasai is hardly a Western-style advocate of women’s rights. She sometimes recommends that men “subdue their wives.” Even in seemingly clear-cut cases of domestic abuse, she often resists defendants’ initial pleas for separation.

When Rasai finally spoke again, she asked Farima what gifts Zabiullah had given her for their engagement. Farima’s mother left the courtroom and returned dragging a metal trunk, full of clothes, jewelry and cosmetics. Her mother pulled out one item at a time and held it above her head for the court to see. “Where are the other rings?” Zabiullah burst out.

“That’s all that you gave me,” Farima replied, exasperated.

“Even if Karzai demands it, I will not allow my daughter to marry this man!” Farima’s mother suddenly exclaimed. It was the kind of support Farima had never received from her parents.

Rasai started scribbling.

“Your engagement is scrapped,” she said. “You no longer have any relation to each other.”

Farima looked defiant, but she did not smile. She and Zabiullah dipped their thumbs in ink and touched them to certificates pronouncing their separation.

“Keep this with you forever,” Rasai said, giving each a copy.

Farima’s parents helped carry her down the stairs. She had lived to get what her family had denied her. Her Afghanistan again showed a flash of modern promise.

“I have defended my rights,” Farima said in the lobby. Her mother was crying.

Two weeks later, Farima was back to spending her days at home. She was reading a book called The Gift of the Bride. “It’s about relationships between wives and husbands and children,” she said. She was no longer attending school. Her father and brothers had asked her to stop during her engagement, and they would not allow her to return.

Farima was still basking in the court’s judgment. But it left her feeling unmoored. Even in the country’s most developed city, opportunities are limited for a single woman unable to walk on her own. “I’m worried that no one will marry my daughter now,” her mother said.

Zabiullah is sure that he will marry another woman. He has a trunk full of gifts ready for her. Farima has started considering the prospect of a life alone, in her childhood bedroom. “I’m not sure what I will do,” she said. “I’m not sure what I can do.”

In the Afghanistan of her novels, the girls grow up to be happy and marriages are full of love. Husbands are patient and accepting.

“For me, it is not always like that,” Farima said. “Life is complicated.”