BEIRUT — When a Syrian warplane gathers speed along the runway, seconds from takeoff and minutes from action, a covert race to save civilian life begins.

It starts in nearby Syrian hills with a single flight spotter and his cellphone. Moments later, details of the flight are beamed to a server abroad, analyzed to identify targets and then converted into warnings that are blasted back into the country via social media. Across rebel strongholds, rescue workers pull on their boots as surrounding hospitals brace for casualties.

“Everyone is holding their breath,” Abu Zeid, one of the plane spotters, said in a recent interview. “It’s a wait that feels like hell.” 

As rebels battling President Bashar al-Assad’s government have fought on the ground, Syrian and more recently Russian jets have pounded opposition territory from above, shattering neighborhoods and killing or maiming many of the hundreds of thousands of people who live there.

That carnage has forced innovation. Civilians, at first, used walkie-talkies to warn of warplanes. Fledgling rescue teams developed ever more sophisticated ways to liberate families from the rubble. In hospitals, doctors developed workarounds for when lights go out and drugs run dry.

And then in 2016, a team of computer developers found a way to link all those efforts.

The result is Hala Systems — known to many Syrians as the Sentry system — an organization that can win crucial minutes for residents to find safety when warplanes are thundering toward them.

“We set out to disrupt the nature of warfare, even in a very small way,” said American entrepreneur Dave Levin. “It was a crazy idea, but we decided it would be unconscionable not to try.”

Levin founded the operation with former U.S. diplomat John Jaeger, a Middle East hand, and with a Syrian computer coder who asked that his name be withheld for fear of Syrian government reprisal. The undertaking is financed by Western governments and the donations of friends and family. 

First, the team needed a human network, and month by month they developed one. Reaching out through trusted contacts, they recruited teachers, engineers and even farmers as potential plane spotters, some living near Russian or Syrian air bases, others in the heart of opposition-held territory.

Equipped with a simple smartphone app, these volunteers watch the skies on eight-hour shifts and, when an aircraft appears, share information about its location, direction and, if possible, type.

That information is refined with complementary data from remote sensors. Hidden atop trees and tall buildings, these collect acoustic data that can be used to determine speeds and aircraft models.

Seconds later, Hala’s software compares the new information with that from previous episodes, calculates the chances of an airstrike and arrives at predictions for the aircraft’s likely targets, as well as when an attack might occur.

The projections are immediately broadcast over social media channels, and a network of alerts is triggered.

When warplanes approach, sirens wail in the street and parents scoop up their children as they run for basements. In hospitals, flashing lights warn doctors that their doors could burst open with casualties. 

A preliminary analysis commissioned by Hala suggests that the technology has helped save hundreds of lives and prevent thousands of injuries.

 As a Russia-backed offensive pounded the Damascus suburb of Eastern Ghouta earlier this year, residents scheduled their lives around Hala’s warnings. 

“They were the only glimmer of hope that we had,” said one former resident, speaking on the condition of anonymity out of safety concerns. “It’s hard to believe we survived those days, truly. So many people died.”

The early warnings were widely and rapidly disseminated through Hala’s arrangements with the White Helmets rescue group, which conducts search-and-rescue operations in rebel-held areas, and with opposition-affiliated radio stations and medical facilities.

With Syria’s seven-year war now reaching its final stages — the opposition is hemmed into northern Idlib province, and most of the country has been restored to government control — the spotters may be faced with their most urgent task yet. They may be called on to help soften the blow of what could be the war’s bloodiest offensive.

For the spotters, it’s a dangerous job, putting them at risk of reprisals, and several said threats from pro-government militias were common. The spotters are also exposed at times to airstrikes, although there are no known instances of them being intentionally targeted.

“I’ve sat there delivering warnings as the blasts rage all around,” said Abu Zeid, who fled Eastern Ghouta this year as government forces advanced. 

But the spotters describe the job as a rare chance for action in the face of overwhelming atrocity.

“The violence has been relentless, but you can’t imagine the feeling when these warnings save lives,” said Abdul Razzak, an observer in the opposition-held northern town of Maarat al-Numan. “It’s so big you feel like you’re bursting.” 

On April 4, 2017, one spotter, Mahmoud al-Hasna, caught a radio signal between a pilot and a command center on his handheld walkie-talkie, and it sent shock waves through the network. He had been tracking the squadron commander for months, and he knew that the plane only ran one kind of mission.

“Guys, it has chemicals with it, I am sure of that,” he radioed out, according to a transcript from the day. His panic rose with each new message.

“Guys, tell people to wear masks.”

“There is another aircraft behind it.” 

Minutes later, the warplanes dropped nerve gas on the northern town of Khan Sheikhoun, and scores of civilians suffered agonizing deaths. Many were killed in their sleep.

Jaeger said it was unclear whether Hala saved lives during this attack, which took place during the system’s rollout phase. “I wish more people could have received our warning that day,” he said.

In May of this year, the Hala team learned that Hasna had been killed in his hometown, Kafranbel, in Idlib province.

His application sprang back to life the next day.

In the organization’s head office, the Syrian co-founder was stumped. How could a dead man warn of incoming warplanes? Hasna’s widow would answer the mystery. 

The morning after the spotter’s death, she found their 7-year-old son in his seat. He had watched his father for years, first using his walkie-talkie to warn residents of incoming airstrikes and later joining a nationwide effort with Hala. So when a plane crested the horizon, he knew what to do, and he grabbed the phone, found the app and spread the word.

Zakaria Zakaria in Istanbul contributed to this report.