US Gen David Petraeus has formally taken command of the 130,000-strong international force battling insurgents in Afghanistan.
The general, whose strategy in Iraq won praise and reduced violence, took over at a modest military ceremony in Kabul.
Hoping to repeat his Iraq success, the general insists Nato and the Afghan government must work hand-in-hand.
As an indication of his task, June was the deadliest month for foreign troops since 2001, with 102 killed.
Gen Petraeus has already warned that Taliban militants are confident and resilient, and he takes command at a time when the war is entering a difficult phase, the BBC's Quentin Sommerville reports from Kabul.
The general arrived in Afghanistan on Friday night and spent Saturday meeting US, Afghan and other officials.
Determination
Sunday's ceremony saw Gen Petraeus assume command under the gaze of troops from the more than 40 nations that make up the International Security Assistance Force (Isaf).
"We are engaged in a tough fight. After years of war we have arrived at a critical moment," he told those assembled just outside the coalition's headquarters.
Calling the battle in Afghanistan "a contest of wills", Gen Petraeus said the coalition would not back down against the Taliban, despite a number of gloomy analyses of the war's progress.
"We are in this to win," the new commander said.
He paid tribute to his predecessor, Gen Stanley McChrystal, who was sacked after he and his aides mocked and criticised political leaders in Washington and Kabul.
He made "enormous contributions" in Afghanistan, Gen Petraeus said, praising the outgoing commander's "vision, energy and leadership".
'Tough mission'
Gen Petraeus has already warned that the conflict may become more difficult before major improvements are won.
He and US President Barack Obama have both insisted a change of personnel at the top does not mean a change in strategy.
"This is a tough mission, there is nothing easy about it," the general said on Saturday, at a US embassy event.
"But working together we can achieve progress and we can achieve our mutual objective."
The gathering on the lawn was upbeat with a rock band playing while dignitaries sat in tents eating popcorn, hamburgers and ice cream, the Associated Press reports.
But the positive tone was dampened by talk of Friday's deadly attack on a house used by an American aid organisation in the northern city of Kunduz, and the accidental killing of two Afghan civilians during a raid in the south, the news agency adds.
US Ambassador to Afghanistan Karl Eikenberry welcomed Gen Petraeus at the embassy gathering, saying: "Welcome aboard. You are welcome at this embassy 24-7."
Mr Eikenberry was one of the US officials criticised by Gen McChrystal in the Rolling Stone article that led to his sacking.
Kandahar challenge
The general also met Afghan President Hamid Karzai to discuss corruption among other issues, according to a statement issued by the presidential palace.
Mr Karzai used the meeting to complain about what he said were "baseless" allegations made by Congresswoman Nita Lowey, a Democrat from New York, who suggested Afghan government officials had misused or pocketed donor funds.
One of the general's impending tasks is to step up operations against the Taliban in Kandahar province.
The campaign has been postponed until September.
He has promised to use the same counter-insurgency tactics he used in Iraq and that Gen McChrystal introduced in Afghanistan earlier this year.
Gen Petraeus has also pledged to look at the application of the current rules of engagement.
These are designed to reduce civilian casualties but some US troops believe they put them at too great a risk.