WASHINGTON  President Obama rejected comparisons on Monday between the war in Afghanistan and the conflict in Vietnam a generation ago, but he expressed concern about “the dangers of overreach” and pledged a full debate before making further decisions on strategy.

The president’s comments, in an interview at the White House with The New York Times and CNBC, appeared to be a response to rising unease within his own party in Congress about the possibility of the United States becoming bogged down in Afghanistan.

Asked whether he worried about repeating the fate of President Lyndon B. Johnson, who declined to seek re-election in 1968 as a result of the turmoil over Vietnam, Mr. Obama replied: “You have to learn lessons from history. On the other hand, each historical moment is different. You never step into the same river twice. And so Afghanistan is not Vietnam.”

But, he added, “The dangers of overreach and not having clear goals and not having strong support from the American people, those are all issues that I think about all the time.”