KABUL, Afghanistan  Vice President Joseph R. Biden Jr. met with President Hamid Karzai here on Tuesday and promised a lasting American commitment to the country well beyond 2014, when NATO forces are scheduled to turn over security of the nation to Afghan forces.

“The United States, if the Afghan people want it, are prepared and we are not leaving in 2014,” the vice president said during an unannounced visit to Kabul, in which he offered aid and military training beyond the planned transition deadline of 2014. “Hopefully, we will have totally turned over to the Afghan security forces the ability to maintain the security of the country, but we are not leaving if you don’t want us to leave.”

Mr. Biden’s news conference at the presidential palace followed what Mr. Karzai described as a working lunch with him, Gen. David H. Petraeus, the top coalition commander, and Karl W. Eikenberry, the United States ambassador to Afghanistan. After lunch, Mr. Biden and Mr. Karzai met for more than an hour in a one-on-one meeting.

Mr. Karzai said the discussion focused on several issues, including the strategic partnership agreement between the nations, security in Afghanistan and the region as well as the process of turning over security responsibilities to Afghan forces.