US Defense Secretary Jim Mattis and Nato chief Jens Stoltenberg renewed their commitment to Afghanistan on Wednesday, as the Taliban launched a rocket attack that wounded five civilians in Kabul. 
Mattis is the first member of US President Donald Trump's cabinet to visit the war-torn country since Trump pledged to stay the course in America's longest war.
In a sign of the country's continuing insecurity a volley of rockets landed on a house near Kabul international airport hours after Mattis flew in, the interior ministry said. 
Five members of the same family were wounded in the assault claimed by the Taliban, which said on social media the missiles had been aimed at Mattis's plane
A stand-off between security forces and the attackers is under way.
The unannounced high-level visit comes as Afghanistan's beleaguered security forces struggle to beat back the Taliban, which has been on the offensive since the withdrawal of US-led Nato combat troops at the end of 2014. 
Mattis, along with Stoltenberg, was to hold talks with President Ashraf Ghani and other top officials to discuss the US-led Nato "train and assist" mission designed to strengthen Afghanistan's military so it can defend the country on its own. 
At a joint news conference with Ghani at the presidential palace, Mattis and Stoltenberg pledged the support of US and Nato allies to the Afghan conflict and expressed determination to stop the country becoming a safe haven for terrorists.
The foreign assistance would give Afghan forces a "compelling battlefield advantage over anything the Taliban stands to mass against" it, Mattis told reporters.
Stoltenberg said: "The more stable Afghanistan is the more safe we will be," adding that more than 15 Nato members had agreed to send additional troops.
US generals have for months been describing the situation in Afghanistan as a stalemate, despite years of support for Afghan partners, continued help from a Nato coalition and an overall cost in fighting and reconstruction to the United States of more than $1tn.
The war turns 16 in October and America is pressing Nato partners to increase their own troop levels in the country to help Afghan forces get the upper hand in the grinding battle against the Taliban and the Islamic State group. 
The resurgent Taliban have promised to turn Afghanistan into a "graveyard" for foreign forces and have been mounting deadly attacks as they maintain their grip on large swathes of the country. 
As of February only about 60% of Afghanistan's 407 districts were reported to be under government control, according to the US watchdog agency SIGAR. 
Slapdash training  
Under Trump's plan, the US is sending more than 3,000 additional troops to Afghanistan, on top of the 11,000 already on the ground, to train and advise the country's security forces.
Nato allies have around 5,000 troops deployed around the country. 
Critics have questioned what the extra US soldiers can accomplish that previous forces -- who numbered some 100,000 at the height of the fighting -- were unable to.
Earlier this year Ghani ordered a near-doubling of the country's Special Operations Command -- the elite fighting force spearheading Afghanistan's war against insurgents -- from 17,000 as part of a four-year plan that also aims to strengthen Afghanistan's air force.
While Afghan authorities have welcomed Trump's open-ended commitment to increase US troop numbers, they know it will take time to improve the fighting abilities of their own forces.
Afghanistan's soldiers have been severely demoralised and weakened by huge casualties, desertions and corruption. 
In an acknowledgement of their impotence, the government is considering a plan to train and arm 20,000 civilians to defend territories where Islamic militants have been driven out.
Earlier this week SIGAR criticised US efforts to train Afghanistan's security forces, saying they were being hampered by slapdash instruction, shoddy oversight and failures in governance. 
Mattis flew to Kabul from New Delhi where he met his Indian counterpart Nirmala Sitharaman, who made it clear that India would not deploy troops to Afghanistan as part of Trump's strategy.
Related Story