BAGHDAD — American warplanes began airstrikes against Islamic State positions in Tikrit late Wednesday, finally joining a stalled offensive to retake the Iraqi city as American officials sought to seize the initiative from Iran, which had taken a major role in directing the operation.

The decision to directly aid the offensive was made by President Obama on Wednesday, American officials said, and represented a significant shift in the Iraqi campaign. For more than three weeks, the Americans had stayed on the sideline of the battle for Tikrit, wary of being in the position of aiding an essentially Iranian-led operation. Senior Iranian officials had been on the scene, and allied Shiite militias had made up the bulk of the force.

Mr. Obama approved the airstrikes after a request from Prime Minister Haider al-Abadi on the condition that Iranian-backed Shiite militias move aside to allow a larger role for Iraqi government counterterrorism forces that have worked most closely with United States troops, American officials said. Qassim Suleimani, the commander of the Quds Force of Iran’s Islamic Revolutionary Guards Corps who has been advising forces around Tikrit, was reported on Sunday to have left the area.

The United States has struggled to maintain influence in Iraq, even as Iran has helped direct the war on the ground against the Islamic State. But as the struggles to take Tikrit mounted, with a small band of Islamic State militants holding out against a combined Iraqi force of more than 30,000 for weeks, American officials saw a chance not only to turn the momentum against the Islamic State but to gain an edge against the Iranians.