Moscow and Ankara appeared close to the brink of war in late 2015 after Turkish jets shot a Russian warplane out of the sky over Turkey's border with Syria. But Putin restored relations with Erdogan after a coup attempt nearly unseated the Turkish leader.
The two countries have increased their co-ordination in Syria, where Turkish-backed rebels have sought to overthrow Syrian President Bashar al-Assad, a Moscow ally.
Along with Iran, the two countries hosted talks in Kazakhstan last month to manage a ceasefire between rebel factions and the Syrian Government.
Last month, Russia and Turkey announced that they would begin co-ordinating strikes against Isis.
The two countries have maintained warmer relations despite dramatic incidents, including the assassination of Russia's ambassador to Ankara in December by a lone gunman who yelled "God is great!" and "Don't forget Aleppo, don't forget Syria!"
In recent days, rebel and Turkish reinforcements have been converging from the north on the outskirts of al-Bab for what rebel commanders said is expected to be a major push to eject the militants.
Meanwhile, Syrian government forces have also been advancing on the town from the south, setting up a race for control of al-Bab between Turkish-backed forces and those loyal to Assad.
Russia has been providing air support to both sides. It was unclear whether the errant strike on Thursday was conducted in support of Syrian or Turkish operations there.
The attack also coincided with reports of the first direct clashes between Syrian forces and Turkish-backed rebels on the outskirts of al-Bab, threatening to turn the battle into a three-front, international war.
Photographs posted on social media by rebel groups showed rebels driving an armoured vehicle said to have been commandeered from government forces. It was not immediately clear whether the skirmishes would develop into a more serious confrontation between Turkey and Syria. If they do, the Russian-Turkish alliance could be at risk, and the United States, which has also been providing air support to the Turkish-backed offensive, could find itself drawn more deeply into Syria's war.
Battle lines in the area have become increasingly complex owing to the large number of forces, foreign and local, on the ground and in the air.
Turkey accelerated its offensive on al-Bab on Wednesday, at roughly the same time that President Donald Trump held his first telephone call with Erdogan, according to Syrian rebel commanders.
Erdogan is hoping to persuade US military commanders to partner with the Turkish-backed force fighting in Syria - rather than arm Syrian Kurdish fighters linked to the Kurdistan Workers' Party, or PKK, which Turkey considers a terrorist group. The ground force would be used in a final assault on Isis' self-proclaimed capital in the northern Syrian city of Raqqa.
Trump's advisers have been sceptical about a plan to arm the Kurds, but have not ruled it out.