A new security regimen at Ataturk airport apparently helped disrupt the plans of three terrorists looking to penetrate deeper into the terminal and wreak more havoc, Turkey's prime minister said Wednesday.

The attackers' suicide bombs killed 42 people, but the death toll was likely lower after an encounter with guards at the terminal's doorway forced them to split up and set off the explosives earlier than planned.

READ MORE: Istanbul Ataturk Airport attack: 42 killed and hundreds injured in suicide bombings

The attack at the Istanbul airport Tuesday also wounded more than 230 people, but from all accounts could have been much worse.

“When the terrorists couldn’t pass the regular security system, when they couldn’t pass the scanners, police and security controls, they returned and took out their weapons out of their suitcases and opened fire at random at the security check,” Prime Minister Binali Yildirim said.

The new approach of placing armed officers directly outside the facility came after bombings at Brussels airport and a nearby subway station killed 32 people in March. Brussels airport shuttered for weeks after suicide attackers detonated bombs at a check-in area, causing extensive damage. The explosions in Istanbul caused far less damage, and the airport reopened early Wednesday.

READ MORE: Istanbul Ataturk Airport attack: 42 killed and hundreds injured in suicide bombings

The Brussels attacks spurred calls for the Transportation Security Administration to move security checkpoints to doorways, but experts pointed out such a move would only push crowds of travelers onto sidewalks or parking lots where they would remain targets.

A better goal, security experts say, is to post armed officers such as local police or National Guard members at all terminal doors to confront suspicious people before they enter the building.

No group has claimed responsibility for the Istanbul operation, but authorities believe the Islamic State is behind the assault. The Dogan news agency, citing unidentified sources, said autopsies on the three suicide bombers suggest they may be foreign nationals.

The three attackers arrived together at the lower-level arrivals hall; one went inside, opened fire and then detonated his explosives, an Interior Ministry official and another official told the Associated Press. During the chaos, the second attacker went upstairs to departures and blew himself up. The officials spoke on condition of anonymity because they were not authorised to speak publicly about the investigation.

READ MORE: Istanbul Ataturk Airport attack: 42 killed and hundreds injured in suicide bombings

Police officers at the airport became suspicious of a man wearing a jacket in the summer heat just outside the terminal and began to follow him, Turkey’s Hurriyet newspaper reported. The suspect met with two other men. The three attackers realized they were being watched and started shooting at police before one of them detonated a suicide belt, the newspaper said.

The third man waited outside during the whole episode and detonated his explosives last as people flooded out of the airport, the officials said.

"This attack, targeting innocent people is a vile, planned terrorist act," Yildirim told reporters at the scene early Wednesday, the Dogan news agency reported.

President Obama phoned Turkish President Recep Tayyip Erdogan on Wednesday to express his condolences. He also pledged to dismantle “organizations of hate,” saying the attack in Istanbul shows how little these “vicious organisations” have to offer.

READ MORE: Istanbul Ataturk Airport attack: 42 killed and hundreds injured in suicide bombings

Turkish officials said the dead included at least 13 foreigners, three of them with dual citizenship. The foreigners include five Saudis, two Iraqis and people from China, Jordan, Tunisia, Uzbekistan, Iran and Ukraine, Reuters reported. The Palestinian ambassador to Turkey said a Palestinian woman was killed and six people from the country were injured, according to the Associated Press.

The U.S. State Department did not recommend outright that Americans should not travel to Turkey, but said Wednesday that they should be "situationally aware" while in the country.

Thousands of weary travelers, whose flights were canceled by the attack, began returning to the airport — a major transit point for tourists— at 2:20 a.m., when flights and departure resumed. Debris still littered the international hall amid chaotic scenes as travelers tried in vain to figure out when their flights were due to depart.

"Our flight is supposed to be on time but right now, we don't even have a gate number because the flights are just a mess," said Brian Degitz, 28, a teacher from the U.S. He spoke an hour before he was scheduled to board a flight home with his wife, Ilayda.

"There were a lot of flights canceled so there are a lot of people who have been here all night,” Degitz added. “The mood is very morose, it's really just kind of down. The atmosphere just doesn't feel normal at all."

Leaders around the world condemned the attack. In a public blessing at midday,Pope Francis said he was praying for the victims, their families “and the dear Turkish people."

“May the Lord convert the hearts of the violent ones and support our efforts toward the path of peace," he said.

"My thoughts are with the families of the victims, those injured and the people of Turkey," said Jens Stoltenberg, NATO’s secretary-general. "There can be no justification for terrorism. NATO Allies stand in solidarity with Turkey, united in our determination to fight terrorism in all its forms."

Russian President Vladimir Putin, who also expressed condolences to the Turkish president, says the Kremlin is lifting its ban on package tours to Turkey and ordered ministers to begin other measures to restore relations.

Relations deteriorated last fall after Turkey shot down a Russian warplane at the Syrian border. Erdogan apologized for the incident in a letter Monday.

Contributing: Doug Stanglin in McLean, Va., and Bart Jansen in Washington.