Australian PM Kevin Rudd has told Afghan President Hamid Karzai during a visit to Kabul he is committed to the "long haul" in Afghanistan.
Mr Karzai (right) thanked Mr Rudd and Australia for their help
Mr Rudd also visited some of the 1,000 Australian troops in Uruzgan province.
Mr Rudd, who has said he will pull out combat troops from Iraq, stressed he was committed to reconstruction and stability in Afghanistan.
French President Nicolas Sarkozy also visited Kabul on Saturday and pledged his support to Mr Karzai.
Failure 'not an option'
Mr Rudd swept John Howard from power after 11 years in office in the Australian general election last month.
Mr Karzai thanked Mr Rudd for the work Australian special forces were doing alongside Dutch soldiers in the volatile Uruzgan province.
Mr Rudd said: "We're committed to being here for the long haul."
He added: "Over the next several months, I would also be encouraging other friends and partners and allies in Nato to continue their commitments and where possible extend them."
Analysts say many Western governments have drawn a distinction between Iraq and Afghanistan, where there is believed to be a more focused objective - preventing the Taleban returning to power.
That was the key theme for Mr Sarkozy, who was making a one-day visit to see some of the 1,300 French troops. He was joined by his defence, foreign affairs and human rights ministers.
"Here there is a war against terrorism, against fanaticism, that we cannot and must not lose," Mr Sarkozy told reporters after his talks with Mr Karzai.
"That is why it is important that we help with the emergence of an Afghan state that is legitimate, democratic and modern."
Mr Sarkozy told the US Congress in November that French soldiers would stay in Afghanistan "as long as needed" and that failure was "not an option".
The BBC's Alastair Leithead in Kabul says Mr Sarkozy's rhetoric on Afghanistan has been strong and supportive since his election in May and French fighter jets have now been deployed to the south.
However, Washington and other allies have repeatedly urged France to send troops to dangerous southern and eastern areas to help in the fight against a resurgent Taleban.
Most of the French troops are stationed in relatively secure areas around Kabul.
Mr Rudd had arrived in Afghanistan from a surprise visit to Iraq, where he said Australia would continue to help train the Iraqi army and police.
However, Mr Rudd is committed to pulling out Australia's 550 combat troops by the middle of next year.