Six Afghan National Army cadets will be trained at Pakistan Military Academy (PMA) Kakul in Abbottabad in Khyber-Pakhtunkhwa province.
The Afghan embassy said that the first ever group of will take part in an 18-month long course.
It a significant breakthrough in relations as Pakistan had long asked Afghan government to use its training facilities to build the national army.
Former Afghan president Hamid Karzai always resisted the move. Pakistan was upset as India was already involved in providing training to Afghan troops.
The relations between the two sides improved after Pakistan sought Kabul's help against militants following the deadly Peshawar attack that left 150 people, mostly children, dead.
Also, a five-member Afghan military delegation led by Afghan National Army Director General of Training, Education and Doctrine Maj Gen Nematullah Khushiwal has arrived in Pakistan on a six-day visit to Pakistan.