- War in Afghanistan (2001-present)
image copyrightEPAimage captionJoe Biden (right) called himself and Ashraf Ghani (left) "two old friends"
US President Joe Biden has said that Afghans "are going to have to decide their future" as Afghan President Ashraf Ghani visited the White House.
Mr Biden promised continued support for the country, even though US and Nato troops are set to finish their withdrawal on 11 September.
It comes as hardline Islamist Taliban fighters have captured dozens of districts in a recent offensive.
Earlier this week the UN expressed alarm at their gains.
The meeting came the day after the US announced plans to evacuate thousands of Afghans who worked for the US military ahead of the withdrawal. Many fear reprisals from the Taliban.
US and Nato officials have recently said that the Taliban have so far failed to live up to commitments to reduce violence in Afghanistan.
- 'We have won the war, America has lost'
- The Afghan war: The short and long story
Speaking in the Oval Office on Friday, Mr Biden called himself and Mr Ghani "two old friends", and said the partnership between the US and Afghanistan "is not ending".
"Our troops may be leaving, but support for Afghanistan is not ending," he said.
But he stressed that it was up to Afghans to decide "what they want", adding: "The senseless violence, it has to stop. It's going to be very difficult."
Mr Ghani meanwhile said that he supported Joe Biden's "historic" decision to withdraw US troops, saying he was there to "respect it and support it".
He also announced that Afghan security forces had recaptured six districts, reversing some recent Taliban gains.
"You will see that with determination, with unity and with the partnership, we will overcome all odds," he said.
The Afghan president – accompanied by Abdullah Abdullah, government chief executive – met members of Congress, the CIA and the US defence secretary on his two-day trip to the US capital.
media captionTop US commander General Scott Miller reflects on NATO forces' time in Afghanistan ahead of its departure