KABUL (Reuters) - A four-year-old boy photographed in a Kabul mosque last week as police desperately tried to call him to safety during an attack by Islamic State gunmen is back with his family but still suffering nightmares, his father said.

Slideshow ( 8 images )

Ali Ahmad was with his grandfather in the Shi’ite Imam Zaman mosque on Friday when at least two attackers in police uniforms stormed in, one exploding a suicide-bomb vest and the other firing indiscriminately at the hundreds of worshippers inside.

A picture by Reuters photographer Omar Sobhani showed Ali standing alone in the courtyard of the mosque as policemen taking cover behind a doorway called and waved to him. He survived the attack but his grandfather was among at least 20 killed.

Click here for a photo essay - reut.rs/2wLBRG8

Sayed Bashir, Ali’s father, was nearby but not in the mosque for the initial blast and ran to check on his family.

“Right after the explosion I thought everything was finished,” he said. “I called my father’s mobile phone number and my son answered and said: ‘They killed grandpa’. He wanted me to bring the car and get him.”

“We were running everywhere in search of my son but the police were stopping us and didn’t let us get close,” Bashir said.

Bashir called the number again and was speaking to Ali when another explosion went off.

“I lost hope. I said to myself that everything was finished. I tried the number again but it was switched off,” Bashir said.

In fact, Ali had run around behind the mosque, disregarding the policeman frantically signaling to him in the courtyard. He was rescued soon afterwards but the effects of the attack may take much longer to heal.

Bashir, a building worker who lives in a district with many Shi’ite families, said Ali was still traumatized and having difficulty coming to terms with what happened.

“After the incident, my son has some problems. He’s scared a lot at night,” he said.

The attack, the latest in a series targeting Shi’ite mosques, was claimed by Islamic State Khorasan, the local branch of the group which takes the name of an old region that included what is now Afghanistan.

According to the United Nations, at least 62 civilians have been killed and 119 injured in six separate attacks on Shi’ite mosques this year.