KABUL—U.S. and Afghan officials on Tuesday said they were getting closer to a deal for U.S. troops to stay in Afghanistan, but they differed over whether the U.S. had committed to a letter from President Barack Obama acknowledging mistakes made by the U.S. in the war.

President Hamid Karzai requested that Mr. Obama write the letter in exchange for softening his opposition to letting American forces raid Afghan homes after the coalition's mandate expires in December 2014, said his spokesman, Aimal Faizi. If made, this American...