Mr. Erdogan later spoke by phone with Vladimir V. Putin, the Russian president, who assured him that Russia had not been involved in the air attack, according to Turkish news reports. The improving ties between the two autocratic leaders opened the door to greater cooperation.

The Turkish military spoke publicly about the Russian role in a Jan. 2 statement that noted that Russian warplanes had struck targets the previous day about five miles south of Al Bab. American officials, who asked not to be identified because they were discussing intelligence, said that Russian airstrikes in the Al Bab area began at the end of December, and that Russian aircraft were flying near Al Bab as recently as Friday.

The effectiveness of the Russian air operations, which have mainly involved dropping “dumb,” or unguided, bombs, is unclear. As Turkey’s casualties have mounted in the Al Bab operation, Turkish officials have complained about the lack of American air support and have even made veiled threats that Turkey might suspend allied combat flights against the Islamic State in Iraq and Syria from its major base at Incirlik, which would be a major blow to the American-led air campaign.

American officials suggested that the holdup in carrying out allied airstrikes in recent weeks was related to a Turkish decision to ban the Americans from flying reconnaissance drones in and around Al Bab to help identify and confirm targets, as well as bad weather. The Turkish military said that measure was needed to ensure that no potentially hostile aircraft flew over its troops, but it has hampered the United States’ ability to carry out airstrikes without endangering civilians.

Operating without the benefit of precise intelligence, the United States recently engaged in what officials called a “show of force” operation in which American aircraft flew low over Al Bab and dropped flares. But last week, the Turks agreed that the United States could fly drones and other aircraft to gather intelligence, which paves the way for the American-led coalition to carry out airstrikes against the Islamic State in Al Bab, American officials said.

The United States regards the Kurdish forces as some of the most effective fighters in the campaign against the Islamic State in Syria. But in deference to Turkish sensitivities, the Americans have declined to arm them directly. The Turks, however, regard them as nothing more than an arm of the Kurdistan Workers’ Party, an insurgent Kurdish group in Turkey and Iraq. The Turks have blamed the group for killing dozens of Turkish security forces in recent weeks.

By any measure, the nascent cooperation between Russia and Turkey is a striking development. The situation was far different when Russian warplanes arrived at Latakia, Syria, in September 2015 to help the Assad government take on rebel groups, including some backed by the United States and Turkey.