(CNN) It had been hours since the terrorists burst into the Dusit hotel complex in Kenya, and you could feel the desperation in the air.

Armed with guns and explosives, they roamed the halls, shooting at anything that moved.

As day turned into night, not much was known about the attack in Nairobi -- word was trickling out in bits and pieces. Those trapped inside sent out pleas on social media, asking people to get them help.

Philip Ogola, a Red Cross volunteer who describes himself as a "digital humanitarian," saw the desperate messages and created a group chat for those trapped in the buildings.

With phones their only connection to the outside world, those shared chats on popular messaging app WhatsApp became a lifeline for the victims during the standoff that started at 4 p.m. on January 15 and lasted nearly 16 hours.

A woman hides behind a car during last week's terror attack at a hotel complex in Nairobi.

First few hours: Fear and uncertainty

The gunshots and explosions popped relentlessly. Some of the people trapped turned off the lights and crawled under tables. Others crouched inside kitchen cabinets. Dazed, bloodied victims occasionally dashed out of the buildings.

Those under siege sent out pleas on the group chat, asking whether help was coming. How long would it take Recce, a Kenyan special forces team, to get to them, they wondered.

Philip Ogola Stay low. Stay calm. Keep your phones on silent. Recce (special forces) team combing floor by floor

Victim We are still hearing gunshots

Victim There was a large explosion ... anything we need to know?

Philip Ogola Alert 🚨

DON'T panic

Recce is advancing

Stay low

Stay calm

Keep your phones on silent

Rescue team combing floor by floor

Victim Thanks for the update. Much appreciated

Victim We all have them on silence, lights off and hidden under the desks

Next few hours: Gunshots, then silence

The hours dragged on. Some started to worry that the rescuers forgot them. Others wondered why the gunfire kept going. When it finally stopped, they questioned why it was suddenly quiet, whether the special forces sent to rescue them had retreated.

"I can hear my eyelids blink," one message said.

Victim We are still hearing gunshots

Victim Why are they shooting?

Are they getting us out today?

Rescuer Security forces are clearing building by building ... they have to move systematically so be patient. Stay down. Barricade yourself. Put your phone on silent, switch off the lights

Victim Thanks we are holding tight

Victim I can hear my eyelids blink (It's so quiet)

Victim Any progress?

Rescuer Recce is combing floor by floor

They have your locations

Kindly be patient. Help is on the way

Night turns to day: A glimmer of hope

The clock ticked past midnight, and Tuesday turned into Wednesday. The usually bustling suburb of Westlands became a ghost town. But outside the complex, Ogola waited with other rescuers and some of the victims' relatives. Authorities gave them an update on what part of the complex the police and special forces were in. Ogola asked those in the group to name their locations so police can get to them.

Rescuer This is for newcomers. Kindly share the building, the floor and number of people you're with, any injuries. Are you in a position to share numbers of your colleagues?

Philip Ogola 14 Riverside Arlington Block

How many people?

Need to share with police

Victim We are about 25-30 people

Victim Hannover Building ... there are many people in there very afraid hoping for someone to come for them

Victim Grosvenor House 4th floor, about 20 people. There are still people hiding in boardrooms and offices.

Victim We are at Grosvenor building ... around 90 guys

Philip Ogola That's the building being combed now floor by floor

Victim 1st floor toilets ... 7 in the toilet ... traumatized.

Almost over: The focus is on the injured

The messages in the group alternated between reassuring the victims and providing medical help to those suffering from gunshot wounds. The group members included a doctor and a Red Cross official who shared tips and images on how to stop bleeding. Issa Premji, a Red Cross official in the group, said the injured victims included a pregnant woman. The tips to stop the bleeding likely saved lives, he said.

Philip Ogola I have added some people from Red Cross

Rescuer And there's a doctor ... he's here to guide you on first aid for the injured

Doctor Hi good people. All will be well. Any one out there with an injury? You can apply dressing with whatever you come across. Injuries on the extremities, apply firm dressing. Use your belt tied tight above the injury

More tips on bleeding management. Use any fabric to arrest the bleeding





Doctor These are some tips on injuries ... and please let this not scare you.

All is well. Please do not panic. If you have some water, some sweets share

Philip Ogola Any other (wounded person)?

The siege ends: Not everyone makes it out

When Kenyan authorities declared the siege over on January 16 -- nearly 16 hours later -- Ogola and other rescuers asked those in the group to check in. Some sent quick one-liners saying they'd been rescued. Others did not say a word -- their batteries had died. But others stopped responding before the guns fell silent. They were among the 21 people killed in the attack.

Rescuer Grosvenor (building) release ongoing ... 50 out. Keep us posted when safe.

Philip Ogola Head count

Victim I was rescued at around 6:30

Victim I was able to get out

Victim Thank you for all the help

Victim Thank you for the constant support and getting us out

Victim God bless you all

Victim Was able to get out ...

Rescuer Please check with Philip on counseling at your convenience. I'm so very sorry for the ordeal that you all went through 🙏🏾

The aftermath: Hope amid chaos

While the number of people rescued from the group is unclear, Ogola said they helped coordinate 124 people during the standoff. The government said a total of about 700 people were rescued from the buildings.

Philip Ogola helped create a group chat during the Kenya terror attack last week.

CNN obtained the WhatsApp group chats, but did not publish them all or identify the people involved because some of them were killed. The people who sent messages in the group chats are referred to as victims to avoid giving away their identities.

Ogola said he created the group with Kenyan journalist Boniface Nyaga after people reached out to them with numbers of relatives trapped in the complex. Those under siege provided details and phone numbers of others trapped with them, and the group grew from there.

They also combed through social media and saw posts from others who were hiding in the complex and asking for help. Before adding people to the group, they tried to verify their identities with their employers or loved ones to ensure the group was limited to victims and rescuers.

"We quickly had to step in to keep them safe," he said. "We started off by telling them, 'please, do not disclose your location on social media. For your safety. Be very discreet. The terrorists are also tech savvy, they could be on social media.'"

Wanjiku Mugo was crouched under a table in an office with about 30 other people between 4 p.m. and 4 a.m. when the special forces rescued them. She said the group kept them calm and optimistic that help was coming.

Before the group was formed, she said, they'd lost hope and had nowhere to turn for information. But inside the pitch-black room, every time her phone screen lit up with a new message, she felt a little more hopeful.