In the deadliest of a series of suicide bombings this year in Turkey, the attackers struck the busy airport, a symbol of Istanbul's role as the Muslim world's most open and cosmopolitan city, a crossroads between Europe and Asia.
Three bombers opened fire to create panic outside the airport on Tuesday night, before two of them got inside and blew themselves up. Two hundred and thirty-nine people were wounded, officials said, giving a full account of the bloodshed.
Prime Minister Binali Yildirim said the attackers shot at random to overcome security checks at the international terminal of Ataturk airport. One blew himself up in the departures hall, a second in arrivals, and the third outside.
Authorities said on Wednesday 41 were killed. The figure is now believed to be 42 after Turkish state-run news agency Anadolu reported an injured woman had died.
"Our thoughts on those responsible for the attack lean toward Islamic State," Yildirim told a news conference in the capital Ankara, adding that investigations should be completed in the coming days and the identities of the bombers revealed.
John Brennan, head of the U.S. Central Intelligence Agency in Washington, also said the attack bore the hallmarks of Islamic State "depravity."
A U.S. official, speaking on condition of anonymity on Wednesday, said U.S. intelligence agencies do not have sufficient evidence to conclude definitively that Islamic State was responsible for the attack.
But the official added that Turkish authorities taking the lead in the investigation may have evidence the United States has not seen.
Turkey is part of a U.S.-led military coalition against Islamic State and home to around 3 million refugees from the five-year civil war in neighboring Syria.
Islamic State has established a self-declared caliphate on swathes of both Syria and Iraq and declared war on all non-Muslims and all Muslims who do not accept its ultra-hardline vision of Sunni Islam. It has claimed responsibility for similar bombing and gun attacks in Belgium and France in the past year.
Erdogan, whose government has taken steps this week to improve relations with Israel and Russia in part to strengthen its hand in fighting against militants, said the attack should serve as a turning point in the global battle against terrorism, which he said had "no regard for faith or values".
U.S. President Barack Obama and Russian President Vladimir Putin condemned the attack in separate phone calls with Erdogan, his office said.
Obama, at a North American summit in Ottawa, Canada, said the United States has offered all assistance available to Turkey and pledged to work with Ankara to fight terrorism.
"We're still learning all the facts, but we know this is part of our broader shared fight against terrorist networks," he told a news conference.
A day after the attack, broken ceiling panels littered the kerb outside the arrivals section of the international terminal. Plates of glass had shattered, exposing the inside of the building, and electric cables dangled from the ceiling.
Cleanup crews swept up debris and armed police patrolled as flights resumed.
"There were little babies crying, people shouting, broken glass and blood all over the floor. It was very crowded, there was chaos. It was traumatic," said Diana Eltner, 29, a Swiss psychologist who was traveling from Zurich to Vietnam but had been diverted to Istanbul after she missed a connection.
Paul Roos, 77, a South African tourist on his way home, said he saw one of the attackers "randomly shooting" in the departures hall from about 50 meters (55 yards) away.
"He was wearing all black. His face was not masked ... We ducked behind a counter but I stood up and watched him. Two explosions went off shortly after one another. By that time he had stopped shooting," Roos told Reuters.
"He turned around and started coming toward us. He was holding his gun inside his jacket. He looked around anxiously to see if anyone was going to stop him and then went down the escalator ... We heard some more gunfire and then another explosion, and then it was over."
Thirteen foreigners were killed, including five Saudis, two Iraqis and citizens from China, Jordan, Tunisia, Uzbekistan, Iran and Ukraine.
One attacker opened fire in the departures hall with an automatic rifle, sending passengers diving for cover and trying to flee, witnesses said. Two other explosions hit the arrivals floor below, one of them just outside the building.
Video footage showed one attacker inside the terminal being shot, apparently by a police officer, before falling to the ground as people scattered. The attacker then blew himself up about 20 seconds later.
"It's a jigsaw puzzle ... The authorities are going through CCTV footage, witness statements," a Turkish official said of the investigation.
The Dogan news agency said autopsies on the three bombers, whose torsos were ripped apart, had been completed and that they may have been foreign nationals. It did not cite its sources.
No group had claimed responsibility, more than a day after the attack, which began around 9:50 p.m. (2:50 p.m. EDT) on Tuesday.