When police reported that al-Shabab extremists had attacked a popular Mogadishu restaurant named Posh Treats in the volatile Horn of Africa country Somalia, many media rushed to tell the world. But Associated Press stringer Abdi Guled was not convinced the report was accurate. His quick calls, including one to an officer at the scene, quickly determined that a place called Pizza House was under assault, not Posh Treats across the street. So while other news organizations had the wrong restaurant, the AP had it right.

This was just the start of Guled’s extraordinary all-night reporting effort. Amid gunfire that left dozens dead, he would put together a riveting story. It’s the Beat of the Week.

It began that evening with the report of a car bomb exploding at the restaurant’s gate. Guled worked the phones, and at about 10 p.m., he decided to see whether he could get close enough to report on the ongoing siege. Soldiers stopped him. He filed details based on what he could see from afar and went back to calling his sources.

Blocked by snipers firing from “every direction,” he found a protected spot under a wall and continued to file with his 4G device.

He managed to stay awake all night “thanks to espresso.” In the early morning, he tried again to reach the scene on foot after police told him he would have access. This time, he was thwarted by snipers firing from “every direction.” He found a protected spot under a wall of a nearby building and continued to file using his 4G mobile internet device. He stayed in touch with videographer Mohamed Sheikh Nor and photographer Farah Abdi Warsameh, directing them to the scene.

Gunfire subsided, and soldiers assumed that all attackers had been killed. But as Guled stood beside a pickup truck near the gate, the shots resumed; a remaining gunman upstairs sent soldiers running for cover again. After a 10-minute gun battle, the last attacker was killed, and the building was secured. Soldiers streamed in, and Guled followed.

First, he saw the body of the Syrian chef, lying in the rubble. Then five bloodied bodies of girls thought to have been killed by the attackers. There were shattered glasses and much blood, bodies lying everywhere.

"I never thought I would have the chance to see the sun again. They were killing people on sight." – survivor Saida Hussein

The gore was too much to bear. Guled stepped out and found Saida Hussein, a university student who had survived the onslaught by hiding behind table. Crying, she was willing to be interviewed but, he said, “I had to comfort her over and over again, so that she could keep talking.”

"I never thought I would have the chance to see the sun again,” she told him. “They were killing people on sight."

He encountered another survivor, Aden Karie, being carried into the ambulance. He had been wounded by an attacker who spotted him moving behind a curtain. "He shot at me twice, and one bullet struck me on the leg," Karie said.

Finally, around 10 a.m., Guled fell asleep. But he turned up the ringtone on his phones, so he would not miss calls from sources. One woke him with the final toll: 31 dead and 40 injured.

For initiative, resolve and courage that gave AP the most gripping and accurate account of the bloody al-Shabab assault, Guled wins this week’s $500 prize.