Three suicide bombers opened fire then blew themselves up in Istanbul's main international airport on Tuesday, killing 36 people and wounding close to 150 in what Turkey's prime minister said appeared to have been an attack by Islamic State militants.

One attacker opened fire in the departures hall with an automatic rifle, sending passengers diving for cover and trying to flee, before all three blew themselves up in or around the arrivals hall a floor below, witnesses and officials said.

The attack on Europe's third-busiest airport is one of the deadliest in a series of suicide bombings in Turkey, which is struggling to contain the spillover from neighbouring Syria's civil war and battling an insurgency by Kurdish militants in its southeast.

Police fired shots to try to stop two of the attackers just before they reached a security checkpoint at the arrivals hall, but they detonated their explosives, a Turkish official said.

"It became clear with this incident again that terrorism is a global threat. This attack, targeting innocent people is a vile, planned terrorist act," Prime Minister Binali Yildirim told reporters at the airport.

"There is initial evidence that each of the three suicide bombers blew themselves up after opening fire," he said, adding that they had come to the airport by taxi and that preliminary findings pointed to Islamic State responsibility.

The vast majority of those killed were Turkish nationals but foreigners were also among the dead, the official said.

"There was a huge explosion, extremely loud. The roof came down. Inside the airport it is terrible, you can't recognise it, the damage is big," said Ali Tekin, who was at the arrivals hall waiting for a guest when the attack took place.

A woman named Duygu, who was at passport control having just arrived from Germany, said she threw herself onto the floor with the sound of the explosion. Several witnesses also reported hearing gunfire shortly before the attacks.

"Everyone started running away. Everywhere was covered with blood and body parts. I saw bullet holes on the doors," she said outside the airport.

Almost seven hours after the attack, which started around 9:50 p.m. (1850 GMT), no group had claimed responsibility.

The attack bore similarities to a suicide bombing by Islamic State militants at Brussels airport in March which killed 16 people. A coordinated attack also targeted a rush-hour metro train, killing a further 16 people in the Belgian capital.

Paul Roos, 77, described seeing one of the attackers "randomly shooting" in the departures hall.

"He was just firing at anyone coming in front of him. He was wearing all black. His face was not masked. I was 50 metres (55 yards) away from him," said Roos, a South African returning to Cape Town with his wife after a holiday in southern Turkey.

"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 towards 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."

President Tayyip Erdogan said the attack should serve as a turning point in the global fight against militant groups.

"The attack, which took place during the holy month of Ramadan, shows that terrorism strikes with no regard for faith and values," he said in a statement.

"The bombs that exploded in Istanbul today could have gone off at any airport in any city around the world," he said, urging all governments to join forces against terrorism.

The United States said it stood in solidarity with Turkey, its NATO ally, and that such attacks would only reinforce their joint determination. United Nations Secretary-General Ban Ki-moon stressed the need to intensify global efforts to combat extremism.

Ataturk is Turkey's largest airport and a major transport hub for travellers from around the world. Pictures posted on social media from the site showed wounded people lying on the ground inside and outside the international terminal.

A helicopter buzzed overhead as police evacuated the building. Dozens of passengers walked back down access roads with their luggage, trying to hail cabs. The U.S. embassy urged U.S citizens to avoid the area.

Authorities halted the takeoff of scheduled flights from the airport and passengers were transferred to hotels, a Turkish Airlines official said. Earlier an airport official said some flights to the airport had been diverted, although Yildirim said air traffic had later resumed.

In the United States, the Port Authority of New York and New Jersey reacted to the explosions by putting armed, high-visibility patrols at the three main airports in the New York metropolitan region.

Turkey has suffered a spate of bombings this year, including two suicide attacks in tourist areas of Istanbul blamed on Islamic State, and two car bombings in the capital, Ankara, which were claimed by a Kurdish militant group.

In the most recent attack, a car bomb ripped through a police bus in central Istanbul during the morning rush hour, killing 11 people and wounding 36 near the main tourist district, a major university and the mayor's office.

Turkey, which is part of the U.S.-led coalition against Islamic State, is also fighting Kurdish militants in its largely Kurdish southeast.

One person was killed on Dec. 23, 2015, when an explosion hit Istanbul's second airport, Sabiha Gokcen, located on the Asian side of the city. That attack was claimed by a Kurdish militant group.

BREAKING: At least 10 dead, dozens more injured in bombing at Istanbul airport https://t.co/lkswnVNEmX pic.twitter.com/jbg1NCS6H5 — Fox News (@FoxNews) June 28, 2016

Breaking News: 2 explosions shook Istanbul‘s main airport, killing at least 10 and wounding many, officials said https://t.co/o2SOE99UEd — The New York Times (@nytimes) June 28, 2016

UPDATE: At least 10 people killed, 40 wounded in Istanbul airport attack, officials said, @CNN reported. — Stratfor (@Stratfor) June 28, 2016

Gunfire was directed from Istanbul airport car park, a witness sayshttps://t.co/yW2DDxDoeR pic.twitter.com/2NQJBbHkRS — BBC Breaking News (@BBCBreaking) June 28, 2016

MORE: Two suspects blew themselves up at Ataturk airport, according to a Turkish official (@Reuters) https://t.co/e2OZDKnOqs — New York Post (@nypost) June 28, 2016

#pts: Initial reports confirm 2 suicide bombers detonated outside pre-check-in security.



"15+ dead & 40+ wounded." pic.twitter.com/HzjSd1aPL9 — Charles Lister (@Charles_Lister) June 28, 2016

UPDATE: Around 40 people wounded in Istanbul airport blast being transported to hospital: broadcaster Haberturk — Reuters Top News (@Reuters) June 28, 2016

Turkish official: two suicide bombers detonated explosives at entrance of int'l terminal of Ataturk airport after police shot at them. — Erin Cunningham (@erinmcunningham) June 28, 2016

Turkish official: Police fired at suspects before security check. 2 suspects blew themselves up — Asaf Ronel (@AsafRonel) June 28, 2016