A little after half-past midday on a sunny Saturday a disturbing call came through to Mark and John at the Nairobi offices of the oil company for which they work. Gunshots had been heard at Nairobi's plushest shopping mall, Westgate, and it was suspected that a robbery was in progress. The security consultants, one an ex-SAS officer and the other a former Irish Ranger, immediately began work on the assumption that it was a terrorist attack.

Within 10 minutes they had contacted all the firm's staff and ascertained that two were inside the mall. They phoned them, to find they were hiding in Westgate's second-floor sushi restaurant, Onami. They told them to stay where they were and the decision was taken to attempt a rescue.

What followed – reconstructed with witness testimony, photographs, video footage and interviews with friends of one of the security men – gives the clearest account yet of official failures, missed opportunities and individual bravery in what is one of the worst-disclosed terrorist attacks on record.

Arriving in the Kenyan capital's shopping and nightlife district of Westlands, Mark and John (not their real names) found that there was no police cordon in place. Bodies were still strewn across the balcony of a ground-floor cafe and gunshots could be heard echoing inside the mall.

They walked into the basement along the exit ramp from the underground car park and made it most of the way to the entrance stairwell before gunfire forced them to retreat.

Coming back out the way they had gone in, they took cover in the cargo area when Mark noticed a crowd of more than 100 people cowering behind an armoured cash-delivery truck.

They approached the terrified people and organised them into pairs to make the dash to the comparative safety of the main road, where a crowd of survivors and onlookers was already beginning to gather. As panicked shoppers and mall staff ran the gauntlet, Mark and John kept watch on the top of the building. Shots could be heard coming from the rooftop car park.

That was when a bloodied hand waved from the rooftop and they took the fateful decision to climb the external fire escape that led into the Java House coffee shop.

Mark, who served for 18 years in the British army, much of it in the SAS, took charge. They persuaded two plainclothes Kenyan police reservists and two more police with AK-47 assault rifles to accompany them up the fire escape towards the shooting.

At the top they went into the coffee shop storeroom and found another group of 100 people sheltering inside. One of the Kenyan police with a rifle was detailed to secure the exit stairs, while they persuaded the terrified people, many of whom had witnessed a bloodbath in the car park outside, to climb down to the ground floor.

There was carnage in the cafe: at least 20 people were dead and the same number injured, many of them with shrapnel wounds from grenades thrown by the Islamist attackers.

At this point, witnesses confirm that Mark and John split up: Mark went out of the building on to the rooftop car park where the attackers had strafed men, women and youngsters attending a children's cooking competition. Meanwhile, John tried to reach the sushi restaurant on the far side of the building and evacuate the diners.

Among the parked cars and marquees which had been erected for the lunchtime event were mothers clinging to children and people with gunshot wounds under vehicles, where they had tried to take cover.

Local radio host Sadia Ahmed remembers that a white man in a checked shirt appeared and began to try to persuade the walking wounded to leave the dead and follow him into the building and on to the fire escape. Many were reluctant to go, insisting that they must know if their loved ones were dead before they would leave.

Mark methodically covered the dead with red tablecloths from the cooking competition. Witnesses said he paired the injured with the uninjured to help them down the stairs. Some were so badly wounded they had to be carried.

Meanwhile, ex-Ranger John had crossed the second-floor balcony, coming under fire from the attackers, now thought to be from the Somali Islamist group al-Shabaab. On reaching Onami, John found the oil company staff and several others hiding in the restaurant storeroom. They were told to hold on to John and two Kenyan policemen for the sprint back across the exposed atrium balcony to the coffee shop.

By 2pm, Mark and John again reached the cargo area. As the Irishman evacuated the firm's personnel to a company car, Mark was seen to approach a police commander and a Kenyan army general who had arrived. A witness described a man in his 50s with short-cropped hair and "an Irish or Welsh accent" pleading with the officers to send help to the car park.

Mark was told that they were waiting for Kenya's equivalent of a Swat team, the "Recce crew", to arrive and would take no action until they did.

Mark and John decided not to wait. They persuaded a non-uniformed Kenyan soldier and a civilian Sikh man, Satpal Singh, who had already helped carry one casualty, to go with them back into the danger zone. "I met an ex-British soldier who said there were still people trapped on the top floor where we came from. He said he had touched the eyes of four people and they were not moving, they were dead," said Singh. "The police officers were armed, they had bulletproof vests, so we [asked them to] … come with us to the top floor and bring these people down. They didn't help us, so we decided to go up again by ourselves."

Back on the roof there was chaos. Volunteers from Kenya's Red Cross had ignored safety warnings and driven an ambulance up into the parking area. They had stretchers and medical kit, but no experience of trauma or triage.

Using the cookery tables as stretchers, the pair worked for an hour alongside the volunteers before a doctor arrived. This is what trauma experts refer to as the "golden hour", the period after major trauma where treatment is most likely to prevent death.

The authorities' failure to secure the roof area probably cost the lives of several of those who later died of their wounds, adding to the known death toll of 67. An unexploded grenade in the midst of the rescue workers was marked with a shopping trolley.

Shortly before 4pm, with only one dead body remaining on the roof and some plainclothes Kenyan soldiers from the General Service Unit arriving, Mark and John decided to leave. That was when one of them, friends said, received a text message saying that someone they knew was still trapped inside. The pair again went back inside the mall, found the man and led him out to the rooftop.

By now, a military helicopter was circling and, worried that they might face "friendly fire", the men retreated back to Java and down the fire escape.

By 4.30pm, there was still no police cordon in place. The pair, two of the unsung heroes of a disastrous government response to the attack, were able to slip away, unidentified, into the crowd.