Obama said the incident was unintentional, and Karzai's office said the US president pledged a full investigation.
In Obama's letter, delivered by US Ambassador Ryan Crocker Thursday in Kabul, "the president also expressed our regret and apologies over the incident in which religious materials were unintentionally mishandled at Bagram Airbase," National Security Council spokesman Tommy Vietor said in a White House statement.
Kabul's office said Obama wrote in his letter that "I wish to express my deep regret for the reported incident."
"I extend to you and the Afghan people my sincere apologies," the letter said.
"The error was inadvertent; I assure you that we will take the appropriate steps to avoid any recurrence, to include holding accountable those responsible," the letter said.
Karzai told members of parliament that a US officer was responsible for the burning that was done "out of ignorance", his office said.