It seemed like a simple question: How old are you?

But when Matteo Bastianelli asked people he met in Bosnia and Herzegovina, he could hear the pain in their answers.

“They start to say, ‘I was 15 when the Bosnian war started,’ ” said Mr. Bastianelli, an Italian photographer. “It’s like people are locked in the past.”

Mr. Bastianelli moved to Sarajevo, the capital, in 2009, drawn to stories he had heard on previous visits. He spent the next four years working on “The Bosnian Identity,” a dark project that explores the hidden emotional wounds left by the 1992-95 war that changed the country. He sought to ask what it meant to move on after enduring such ravaging violence.

“At the beginning, I just looked around me and saw that the city was full of scars,” he said. “The holes made by machine-gun fire are everywhere in Sarajevo. It’s really scary to see.

“But I could not see the scars of human beings.”

Mr. Bastianelli encountered a mass grave for the first time when he joined investigators with the International Commission on Missing Persons in their search for victims. He watched as they collected identity cards and personal items to be handed back to grieving families of the dead from Srebrenica to Cerska. He started to understand why grief was the norm in Bosnia.

“They are locked in the past,” he said, “because they have something inside that cannot be repaired.”

Many of the people Mr. Bastianelli met lost their parents in the conflict. One of his primary subjects, Adis Smajic, was 10 when his father and grandfather were killed. Five years later, he stepped on a mine while going to play soccer with friends.

Mr. Bastianelli met him over coffee in Srebrenica, where Mr. Smajic had been working as a driver for a couple of photographers. Mr. Smajic offered him a cigarette — “and in Bosnia, you cannot say no,” Mr. Bastianelli said. “You always need to say, ‘Yes, of course.’ ”

They met again in Sarajevo, where Mr. Smajic lives with his wife, Naida Vreto Smajic, and their child. Naida works at a shop while Adis sits outside, drinking coffee and smoking cigarettes all day. He belongs to a rap group called Found on da Street, but, like many Bosnians, he doesn’t have a job.

Photo

Mr. Smajic is trying to forget the war. But in cold weather, his leg throbs with pain. When he stands in front of a mirror, he sees the scars — a missing arm and a missing eye.

Mr. Bastianelli didn’t photograph Mr. Smajic at first. “To take a picture of someone, I really need to feel accepted,” he said. “I don’t want to steal pictures.”

But he eventually reaches a certain moment in a relationship — a “frozen moment” — when he is ready.

That happened with Mr. Smajic on the outskirts of Sarajevo, while he was giving Mr. Bastianelli a tour of the mountains. Mr. Smajic turned to him and told him to take all the pictures he wanted. He borrowed Mr. Bastianelli’s camera to take snapshots of the two of them, like a smartphone selfie. (Mr. Bastianelli shot the project on film, using both a Canon and a Holga.)

Photo

For Mr. Bastianelli, those selfies are significant. “I’m present in the picture,” he said. “Sometimes I think that it’s a good project based on him not just because he is a man who has a handicap. It’s just because you can see in the pictures that it’s a person full of life.”

In other words, they became friends.

They traveled to Croatia together and Mr. Smajic visited Mr. Bastianelli in Rome, where he is now based. They drank together — sometimes too much. “He makes me mad sometimes, but that’s our relationship,” said Mr. Bastianelli, who will be the godfather of Mr. Smajic’s child.

“The Bosnian Identity” combines documentary with personal experience, also following the stories a small gang of criminals from Sarajevo and a man named Ammar Mirvic whom Mr. Bastianelli grew to know well.

He has finished the project, which includes a book and a documentary film, but Mr. Bastianelli is far from done with the Bosnian story. He hopes to spend more time in Serbia, where he went in 2012 to see the nationalist Tomislav Nikolic elected president.

“I really think it will be hard for me,” he said. “But I will try.”

Though his priority is to exhibit the pictures in Sarajevo, “The Bosnian Identity” opened Jan. 16 in Velletri, a small town near Rome where Mr. Bastianelli was born. He met with students there last week to talk about the conflict.

He hopes the work will teach them not only something about history, but also about humanity — “the way people are moving on, even if they’ve been through a terrible circumstance like a war,” he said.

“For me, that’s the main reason to work at photography. And it’s a way to understand something more about yourself and the person you are.”

Photo

Follow @kerrimac and @nytimesphoto on Twitter. Lens is also on Facebook.