The sun had yet to rise over the northern Syrian village of Al Tokhar on July 19 when a U.S. airstrike obliterated much of the town, leveling adobe buildings and killing families as they slept.
Soon grisly photos of bloody corpses and grieving survivors began appearing on social media, alerting the world to the carnage.
A Pentagon statement issued Thursday said the bombing of Al Tokhar killed about 100 Islamic State fighters. But it also mistakenly killed up to 24 civilians who, it said, were believed to have fled the area.
The total is far fewer than the 100 or so civilian casualties that independent Syrian monitoring groups blamed on the airstrike. But it's still the worst civilian death toll from a single U.S. raid since the war against Islamic State began in mid-2014.
The case, days after the Pentagon acknowledged a coalition air raid in September had killed dozens of Syrian-backed troops in error, highlights the limits of an air war that relies on highly trained crews and the most high-tech aircraft, targeting and munitions in history.
Six additional botched airstrikes have killed 30 civilians in Iraq and Syria this year, according to the Pentagon, bringing the official civilian death toll from U.S. mistakes to 173 since mid-2014.
Several hundred civilians also have been reported killed in U.S. airstrikes in Pakistan, Afghanistan, Yemen and Somalia in recent years, though exact figures are difficult to pin down.
In all, the Pentagon has received 257 allegations of civilian casualties since mid-2014. It has ruled 181 were not credible. Several officers and crew members have been disciplined, but none has been prosecuted for violating the laws of war.
U.S. officials say the death toll, while regrettable, is still remarkably low given the relentless pace of bombing by coalition aircraft: more than 60,000 munitions have been dropped in Iraq and Syria over the last 30 months.
They also note that Russian and Syrian airstrikes against rebel positions in Syria have killed many more civilians, partly because they have hit hospitals, schools and other targets in the country's bitter civil war.
"Do we make mistakes? Sure, we do, but it isn't deliberate," said retired Air Force Lt. Gen. David Deptula, now dean of the Mitchell Institute for Aerospace Studies in Arlington, Va. "I can promise you: there isn't a military in the world that takes the time and care to avoid civilian casualties like the United States."
The Obama administration's efforts to limit risk to U.S. pilots and ground forces has increased reliance on local forces and surveillance aircraft to accurately identify targets. That has sometimes led to faulty intelligence and inaccurate targeting.
"Even though the U.S. military is unparalleled in their targeting processes, bad things happen," said Micah Zenko, a senior fellow at the nonpartisan Council on Foreign Relations. "The errors come from both the ground and the sky. Advances in technology may improve processes but they can never be made perfect."
On Sept. 10, for instance, U.S. warplanes targeted an Islamic State tactical unit in the militants' Syrian stronghold of Raqqah. It instead killed five civilians, according to a Pentagon investigation.
A week later, an hourlong air raid on a garrison in the eastern Syrian town of Dair Alzour mistakenly killed about 60 Syrian government-backed troops, rather than Islamic State fighters.
Pentagon investigators later determined that an analyst's warning that surveillance did not indicate that Islamic State was at the camp was not forwarded to the commanders who authorized the attack.
On Sept. 28, an American drone had a group of Al Qaeda-linked Shabab fighters in its sights in the north-central Somalian city of Galkayo. It instead mistakenly killed 10 members of an allied militia.
The following day, the United Nations condemned a U.S. airstrike that it said had killed at least 15 civilians in Afghanistan's Nangarhar province. The attack was supposed to be aimed at Islamic State.
Norton Schwartz, former Air Force chief of staff, said the Obama administration is "clearly uncomfortable with the loss of American lives in combat" and has tried to "thread the needle" by carrying out complex operations primarily from the sky.
"Without eyes on the target, you open yourself up to false information and run a higher risk of causing a deadly mistake," he said. "The Air Force will hit whatever we aim at. The question is whether it's the right target."
The military was convinced it had identified the right target in Al Tokhar.
U.S. reconnaissance drones had prowled above the Syrian town for weeks, hunting for Islamic State positions. U.S. aircraft were supporting advancing Syrian Democratic Forces, a loose alliance dominated by Syrian Kurdish militiamen working alongside Arab and Turkmen.
The village was near Manbij, a strategic border town then held by Islamic State but under siege from the rebel forces. Early on July 19, the alliance radioed they were being shelled and feared an Islamic State counterattack.
U.S. and coalition commanders at the air operation center in Qatar responded by scrambling two A-10 attack jets and a B-52 bomber while a drone circled above the town.
Their attack was brief but deadly, said Mohammad, who was reached in Al Tokhar on Facebook but did not want his last name used out of concern for his safety.
"You could say there were 11 or 12 missiles," he said. "On our house, two missiles fell. On the one beside us there were six and the rest on the third house."
Five or six families lived in each house, he said.
"Once the strike occurred, those who were still alive ran out to see what was going on, but once they would get out, they saw the body parts and their neighbors wounded, they would run back inside," he said. "It was horrific."
Jamaily, who also declined to use his last name, said Kurdish and Islamic State fighters had clashed all day. So, he said, his family and others fled north to a refugee camp by a high school.
"They told me they literally flew up in the air from the shaking of the ground" back in Al Tokhar, he said via Facebook.
Photographs of bloody corpses soon began to appear on Facebook and Twitter. One showed a man carrying a limp child coated in dust; another showed a body in a shallow grave.
A U.S. military investigation later found some of the photos were fakes that had been posted online after previous attacks. But some were new and the Pentagon ordered a review of the attack.
Investigators did not visit the village but they reviewed surveillance video "almost frame by frame to find out what happened," said a U.S. military official who spoke on condition of anonymity to discuss the process.
"It turned out, unbeknownst to us, that there were civilians interspersed with the forces we hit," he added.
The Syrian Network for Human Rights, an independent group that tracks casualties in Syria, said up to 98 civilians were killed. It provided names and images of dead bodies, all appearing to be civilian and including children.
"We have a list composed by several sources of evidence: names, photos, videos, testimonies," Fadel Abdul Ghany, director of the group, said. "Like all of our reports, this is not estimation, this is reality."
Special correspondent Nabih Bulos in Amman, Jordan, contributed to this report.