ISTANBUL — A diplomatic rift between Turkey and the United States was patched over late Saturday after the American vice president, Joseph R. Biden Jr., officially apologized to Turkey’s president, Recep Tayyip Erdogan, for remarks suggesting that Turkey helped facilitate the rise of the Islamic State terrorist group.

In remarks at Harvard University on Thursday, Mr. Biden said Mr. Erdogan had admitted erring in allowing foreign fighters to cross Turkey’s border into Syria, eventually leading to the formation of the group, also known as ISIS and ISIL.

Mr. Biden’s spokeswoman, Kendra Barkoff, said in an emailed statement that the two leaders spoke by phone on Saturday. “The vice president apologized for any implication that Turkey or other allies and partners in the region had intentionally supplied or facilitated the growth of ISIL or other violent extremists in Syria,” Ms. Barkoff said. “The United States greatly values the commitments and sacrifices made by our allies and partners from around the world to combat the scourge of ISIL, including Turkey.”

Earlier Saturday, Mr. Erdogan had demanded an apology, saying he had never made any such remark to Mr. Biden. “If Mr. Biden has said such a thing at Harvard, he needs to apologize to us,” Mr. Erdogan told reporters here.