The US has signed a peace agreement with Taliban militants aimed at bringing to an end the near-two-decade war in Afghanistan.

Under the deal signed in Qatar, the US and Nato will withdraw all troops from the country within 14 months – and the US will make an initial reduction in the number of its military personnel to 8,600 within 135 days of the agreement – if the Taliban meets its commitments to prevent terrorism.

President Trump said that Washington was “working to finally end America’s longest war and bring our troops back home”.

The US and Afghan governments said in a joint statement: “The coalition will complete the withdrawal of their remaining forces from Afghanistan within 14 months following the announcement of this joint declaration and the US-Taliban agreement ... subject to the Taliban’s fulfilment of its commitments under the US-Taliban agreement.”

Afghanistan war: lives of children devastated by the endless conflict Show all 20 1 /20 Afghanistan war: lives of children devastated by the endless conflict Afghanistan war: lives of children devastated by the endless conflict Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Nooria*, 15 in the home her family has lived in for the past two years in Mazar-i Sharif She was forced to flee her home with her family after their town was attacked by armed groups. Nooria describes a rocket hitting her neighbours home killing many inside. They fled on foot with just the clothes on their backs and she now lives in Mazari Shariff where Save the Children have enrolled her in school and provide vocational training Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Nooria* hopes for a future with no war; "When they attacked our village, the rocket hit our neighbour's house and they all died. Our house then caught fire and we ran away. My friends who I used to play with - I still don't know if they are alive or if they are dead.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict “I'm hoping for a better future, to learn, to support my family and to get them out of this difficult life. And I'm hoping for a future where there is no war.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Naveed*, 16 at his family home in Mazar-i Sharif Naveed lost his leg when he stepped on a mine aged just 8-years-old. He was herding the family's sheep in the mountains near their home when he triggered a landmine Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict After months of medical treatment his right leg was eventually amputated. He received physiotherapy and a prosthetic leg from the International Committee for the Red Cross in Mazar Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Now enrolled in school, Naveed is being given vocational training by Save the Children. “For around a year I felt and dreamt that I still had my leg. But when I woke up and saw, there was no leg. Sometimes I’d feel with my hand to check and find it wasn't there.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict “If someone has loses their leg, it does not mean that they have lost their mind." Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict "With the help of our minds we can continue to study, learn, and work to make the future of our families brighter.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Naveed and Mahboob*, 55 (Naveed's father) Several years ago Neveed's father, Mahboob, was brutally beaten with rifle butts by armed groups after, he says, he failed to provide food for them while they were stationed in the family's village. He suffered brain damage which affected the right side of his body, speech and his brain function Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Habiba*, 14, and Arezo*, 15 in a village outside Kabul Habiba and Arezo were injured with their mother three years ago in a suicide bombing in Kabul. Arezo is still traumatised from what she saw and has become completely withdrawn Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Arezo's younger sister Habiba cares for her, takes her to lessons and anywhere she wants to go. They are both in school through Save the Children's 'Steps towards Afghan girls' education success' (STAGES) programme, which helps the most marginalised girls get access to education, stay in school and learn. Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Habiba says: “When I woke up and I opened my eyes I saw lots of bodies and I thought I was not alive any more. It was horrible. I'll never forget that. Whenever there is a big sound she gets scared because she was traumatised by the sound she heard during the attack. I love my sister, and I help her with her lessons, I take her anywhere." Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict "She's older than me but I feel like the older one because I support her. I hope for a better future for me and my sister.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Khalida*, 10 in a classroom in a village outside Kabul Two years ago Khalida lost her 18-year old brother when he was killed in an explosion in Kabul. She misses him every day and says the family are still carrying the grief of his loss Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict "Two years ago, my brother was going to Kabul when an explosion happened and he lost his life. We are still carrying the grief and are crying over him. At the time we were happy, everyone was happy. Now no-one is happy in the family. When I remember him, I cry and feel so bad. I hope for peace and that war will stop, and that nobody loses their brother” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict “I want to get education to become a teacher. I want to teach others who have never been to school” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Sema*,11 at her family home in Kabul Sema recalls coming home from her aunt's house and being told that her father had been killed in a suicide attack Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict Sema still thinks about him every second and likes to look at his prayer beads (Tisbeh) to remember him. They hang from the curtain in the family home. She loves school and wants to become a teacher one day. Sema says she wants peace in her country to stop other children losing their fathers. “We still have lots of his belongings, like his car, his clothes, his watch, his shoes. Whenever we see them we cry. He gave us all so much love every moment and he is on our minds. I want for the powerful people around the world to stop the war and bring peace, because I don't want other children to lose their fathers.” Andrew Quilty/Save the Children Afghanistan war: lives of children devastated by the endless conflict “I want to become a teacher to serve the country and I don't want any girls to be illiterate. I want to teach all the girls, so they have access to education.” *Names have been changed to protect identities Andrew Quilty/Save the Children

Jens Stoltenberg, the secretary general of Nato, said the organisation supported the deal and was prepared to reduce the number of troops in the country.

However, he said Nato would increase its presence again should the situation deteriorate, adding: “Peace is long and hard and we have to be prepared for setbacks and spoilers.”

Meanwhile, Antonio Guterres, secretary general of the United Nations, welcomed the deal but stressed the importance of “sustaining the nationwide reduction in violence, for the benefits of all Afghans”.

The peace agreement aims to bring an end to 18 years of bloodshed in Afghanistan, and allow US troops to return home from America’s longest war.

US secretary of state, Mike Pompeo, and Qatar’s minister of foreign affairs, Mohammed bin Abdulrahman al-Thani, in Doha (AFP via Getty) (AFP via Getty Images)

George W Bush, then president, ordered the US-led invasion of Afghanistan in response to the 11 September attacks in 2001.

It only took a few months to topple the Taliban and send Osama bin Laden and top al-Qaeda militants scrambling across the border into Pakistan, but the war dragged on for years as the US tried to establish a stable, functioning state in one of the least developed countries in the world.

The Taliban regrouped, and currently holds sway over half the country.

Mike Pompeo, the US secretary of state, arrived in Doha, the capital of Qatar, on Saturday to witness the signing of the historic deal by US special envoy Zalmay Khalilzad and Taliban political chief Mullah Abdul Ghani Baradar.

Mark Esper​, the US defence secretary, meanwhile travelled to Kabul on a visit that officials and experts said was aimed at reassuring the Afghan government about Washington’s commitment to the country.

The US embassy in Kabul said it was a “monumental day for Afghanistan”, adding in a post on Twitter: “It is about making peace and crafting a common, brighter future. We stand with Afghanistan.”

Hours before the deal, the Taliban ordered all its fighters in Afghanistan “to refrain from any kind of attack ... for the happiness of the nation”.

Zabiullah Mujahid, a spokesman for the hardline Islamist group, said: ”The biggest thing is that we hope the US remain committed to their promises during the negotiation and peace deal.”

He added that it was “irritating and provocative” that foreign military aircraft continued to fly over Taliban territory, but militia fighters were following the order to stand down.

Afghanistan president says US and Taliban will sign peace deal

The British foreign secretary, Dominic Raab, said: “These agreements mark a significant moment in the pursuit of peace in Afghanistan.

“The current reduction in violence is welcome and I hope it will be maintained, but meaningful negotiations between the Afghan leadership and the Taliban are the real prize, and I hope this opportunity will be seized.

“The only way to achieve lasting peace in Afghanistan is through a political solution.”

More than 2,400 US troops have been killed in the war since 2001, along with more than 450 UK troops and tens of thousands of Afghan government soldiers, Taliban fighters and civilians.