In a remote part of Afghanistan early last year, a girl was sentenced to death. Her crime was possession of a cellphone. Her executioners were to be her brothers. They suspected her of talking on the phone with a boy. The girl, in her late teens, had dishonored the family, her brothers said.

"My older brother took the cellphone from me and beat me very badly. It was dinnertime. They told me that they would execute me after dinner. They said to me this would be my last meal," says "Lina," a pseudonym.

The question of how to protect the rights of Afghan women after U.S. troops leave the country has become a key question. But this task hasn't been easy, even with a huge American troop presence in Afghanistan.

Lina's story illustrates the point: When she came to an American military base pleading for help, U.S. officials had to figure out how to save her life without enraging the local community.

"I was terrified to think of running away from home, but suddenly a voice from inside told me to flee before my brothers killed me. Maybe the devil made me do it," says Lina. "I took one of their cloaks and wrapped it around me to look like a man. Then I slipped out of the house and started walking to the foreigner's base nearby."

So-called honor killings are common in Afghanistan, along with other gruesome punishments for women suspected of contact with men outside their family. It's considered a dishonor even when a woman is the victim of sexual assault. Hundreds of women are in Afghan prisons for "moral crimes" such as being the victims of rape.

Seeking Refuge

It's not clear if her brothers knew it, but Lina says one of her in-laws was regularly abusing her — physically and sexually. Women in remote villages have little recourse, almost no route of escape. Most spend their lives barely leaving the house. Advocates say they have heard of only a few cases where Afghan women approached American bases for help.

"She approached the gate. When they realized she was in danger, they took her in," says U.S. Marine Maj. Jennifer Larsen, who was to become Lina's almost constant companion for the next several weeks. (The location of the base is also being withheld to protect Lina.)

Larsen says the guards at the gate saw the same car passing again and again. Each time it drew near, Lina looked petrified. They took her to a doctor who discovered fresh bruises on her back and knees from the beating. After treating her, Lina moved into a tent with three American women and an Afghan translator — her exposure to male soldiers on the base was limited.

But even that small corner of the American base was a new world for Lina, after a life of sequester in the village. Things like television and hot running water were new — as was the existence of books, written words and even written numbers.

But Larsen says the girl embraced them. She devoured new foods from the cafeteria, especially ice cream and Doritos. She quickly gained a small English vocabulary, including phrases from the PG-rated movies they watched to pass the time. Some showed men and women kissing. "Kiss" was a favorite new word, says Larsen.

"She was scared and overwhelmed, but she was a strong person, and as she had new things come to her, she adapted quickly. I found out she was very bright," says Larsen.

"She wanted to get away from where she was. Anytime you asked her a question, her answer was, 'Do I have to go back?' Our answer at the time was 'no,' and we had to figure out how to keep that promise," Larsen says.

Pressure To Return

But saving a teenage girl was not part of the battle plan for U.S. forces in Afghanistan — it might even have jeopardized that mission.

Afghan advisers told Americans at the base very bluntly: To keep peace with the community, Lina had to go home, even if it meant her death. Her original "crime" now paled in comparison to the fact that Lina had spent weeks living with non-Muslim soldiers, says Huma Safi, a women's rights advocate in Kabul.

"In Afghan society, women stay with their families. When they spend nights in other places, it's a dishonor for their families. It's not just the military base ... they don't want their daughters to spend the night anywhere," says Safi.

An elder from the community stayed on the base with Lina, but he stopped speaking to her once she said she wanted to stay with the foreigners. Her family also tried to convince her to come home, but Lina knew it was a trick, says Larsen.

"The hard part was as I watched her sister beg her to come home. Even her niece and nephew, who were very young, were there as well," Larsen says. "She was glad to see them, she hugged them and kissed them. But as soon as her sister even suggested that she come back home, the whole meeting came to a screeching halt. She had no time for her sister, and she asked her to leave. It was hard to watch. At that moment, an interpreter was unnecessary."

Lina also saw her brothers again — they surprised her by showing up at a meeting near the base. Larsen says she feared the brothers might try to kidnap Lina or even throw acid on her at the meeting. Lina says she knew her family planned to lure her home to kill her.

"My brothers pleaded with me to return home. I told them no. They said they would let me marry whoever makes me happy. I asked them, 'Why would I ever believe you?' " Lina says.

This is where the story in Afghanistan often ends: The woman is sent home, and later killed by her family to cleanse the dishonor.

But Lina's tale has a rare happy ending. U.S. officials helped fly her to a women's shelter in a larger city, while Afghan officials in her province agreed to look the other way.

A Life Of Hope

Women's shelters in Afghanistan can be virtual prisons, and Lina says she felt depressed after about eight months there. But the same pluck that helped her escape death served her again.

When she was brought before a female Afghan judge, Lina asked for help. The judge said she knew a young man looking for a wife. Lina insisted on seeing him first, and that she not be made a second wife to a married man. They met, and after a short discussion, decided to get married. She is now expecting her first child.

Larsen, Lina's Marine caretaker, says that news brought tears to her eyes.

"It's overwhelming sometimes. I don't even know what to say. There are so many women who have this issue. It would be nice if there was something we could do that was tangible, but I don't know what that thing is," Larsen says. "We did help one, and hopefully she'll be able to help others in the future."

Speaking by phone from her new home, Lina says she wants for nothing. After fleeing her home with only the clothes on her back, she now wears the traditional rings and necklaces given to a bride by her husband.

Lina's husband is aware of her past and, unlike most men in this deeply conservative society, is still accepting of her. She says she'll never forget the Afghans and the Americans who helped her escape.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.