“You are not alone,” she told Mrs. Shams. “There are many women like you in Afghanistan.”

In the hours after her healthy daughter was born, Mrs. Shams broke down.

“I was in pain, but the loneliness of it was much stronger,” she said. “I cried a lot — for being a woman, for being a widow at 22, for being the mother of two girls. I thought about the future, about Shams, about loneliness.”

She added, “I think loneliness is the strongest pain in the world.”

For Sofia, her firstborn, the baby sister was a welcome distraction. But the older girl still struggled. Every time the phone rang, Sofia would think her father was on the line. She would cry and wanted to talk.

More recently, Sofia has stopped asking about him. She hates the phone, and has started referring to her uncle as father.

But the reminders of Mr. Shams will always be there, in the framed photos on the wall, in the visits to his grave, her hand in her mother’s hand. And in something more personal, her birthday: On April 12, the day her father was killed, Sofia turned 3 years old.

Mrs. Shams recently felt a glimmer of hope. A relative told her he could help her find a job as a vaccinator, a small step toward breaking the shackles of dependence and shaping her own future.

Days later, the relative was killed in a suicide bombing outside a demonstration in Kabul.

“I just want to leave this country and go somewhere peaceful,” she said. “Somewhere where no one is killed and no one loses their life.”