ANKARA (Reuters) - Turkish President Tayyip Erdogan and U.S. President Donald Trump agreed in an overnight phone call on joint action against Islamic State in the Syrian towns of Raqqa and al-Bab, both held by the militants, Turkish presidency sources said on Wednesday.

Turkish President Tayyip Erdogan makes a speech during his meeting with mukhtars at the Presidential Palace in Ankara, Turkey, February 8, 2017. Yasin Bulbul/Presidential Palace/Handout via REUTERS

U.S.-Turkish differences during former President Barack Obama’s administration impeded the U.S.-led campaign against Islamic State, and closer coordination could mean faster progress towards freeing swathes of northern Syria from IS.

Erdogan now hopes that relations with Washington, strained by the presence in the United States of a cleric he blames for an attempted military coup last year and by U.S. support for Kurdish militia in Syria, can be reset under Trump.

Turkey has the second largest army in the NATO alliance and is key to any success in rolling back and eventually neutralising IS in Syria and Iraq where IS declared a cross-border caliphate after lightning advances in 2014.

Turkey has presented a detailed plan to oust Islamic State from its Raqqa urban stronghold in northeastern Syria and strategy discussions with the Trump administration are under way, according to Erdogan’s spokesman, Ibrahim Kalin.

“The operational details were not discussed on this call ... Now detailed planning will be conducted in coordination,” he told Turkish broadcaster NTV in an interview.

Ankara believes recent IS attacks in Turkey, including a New Year’s Day shooting in an Istanbul nightclub that killed 39 people, have been steered from al-Bab and Raqqa, and regards a clear-out of the towns as a national security priority.

Turkish government and Syrian rebel sources said on Wednesday insurgents backed by Turkey’s military had taken the outskirts of al-Bab, northeast of Aleppo. If al-Bab falls, Ankara would strengthen its sway over an area of northern Syria where it has created a de facto buffer zone.

Syrian government forces have also advanced on al-Bab from the south, bringing them into close proximity with their Turkish and rebel enemies in one of the most complex battlefields of Syria’s six-year-old civil war. But Turkey said international coordination was under way to prevent clashes with Syrian forces.

The White House said that in the phone call, Trump spoke about the two countries’ “shared commitment to combating terrorism in all its forms” and welcomed Turkish contributions to the fight against Islamic State. But it gave few details.

Sources in Erdogan’s office said the two leaders had touched on issues including a “safe zone”, as well as the regional migrant crisis and the fight against terrorism. Turkey has long advocated a secure zone for displaced civilians in Syria threatened by Islamist militants or forces fighting for Syrian President Bashar al-Assad.

They also said Erdogan had urged the United States not to support the Syrian Kurdish YPG militia and that new CIA Director Mike Pompeo would be in Turkey on Thursday to discuss that and other issues with Turkish counterparts.

A rebel fighter stands near a Turkish tank as it fires towards Guzhe village, in Syria's northern Aleppo countryside, October 2016. REUTERS/Khalil Ashawi

There was no immediate confirmation from Washington of Pompeo’s visit. But the offices of both leaders said Trump had reiterated U.S. support for Turkey “as a strategic partner and NATO ally” during Tuesday’s phone call.

Turkey has long urged world powers to help create a safe zone, which it also sees as a way to purge its border of Islamic State and Kurdish militia fighters, and stem a wave of migration that has caused tensions with Europe.

Obama and U.S. allies balked at the idea, saying it would entail significant ground forces and planes to patrol a “no-fly zone”, a dicey commitment in such a crowded and messy conflict.

“TWO FUNDAMENTAL ISSUES”

The Syrian Democratic Forces (SDF), an alliance of U.S.-backed militias, launched a new phase of its campaign against Islamic State in Raqqa on Saturday.

Turkey has repeatedly said it wants to be part of the U.S.-led operation to retake Raqqa from the ultra-hardline Sunni militant Islamic State, but does not want the YPG, which is part of the SDF alliance, to be involved.

Relations between Erdogan and Obama soured over U.S. support for the YPG, which Ankara regards as a terrorist group and an extension of Kurdish insurgents fighting inside Turkey.

The Turkish army and Syrian rebel groups it supports have been fighting IS in a separate campaign around al-Bab, northeast of the city of Aleppo. Ankara has complained in the past about a lack of U.S. support for that campaign.

Kalin said there had been better coordination with the U.S.-led coalition on air strikes in the last 10 days. He added that Ankara’s priority remained the creation of a safe zone between the Syrian towns of Azaz and Jarablus, a strip of border territory to the north of al-Bab.

The Turkish sources said Pompeo would discuss both the YPG and steps against the network of U.S.-based Turkish cleric Fethullah Gulen, whom Turkey accuses of orchestrating last July’s coup attempt. Gulen denies any involvement.

Turkey has been frustrated by what it considers to be Washington’s reluctance to hand over Gulen, who has lived in self-imposed exile in Pennsylvania since 1999.

“As you know, we have two fundamental issues with the U.S. administration inherited from Obama’s period. One is the support given to YPG and the other is the (Gulen) problem,” Kalin said.

“Our president spoke about these openly and clearly. Trump was informed on these and, without going into too much detail, he said let’s ask our teams to work on this and let’s give the necessary instructions.”