Hagel said Afghanistan had "come a long way" over the past decade and that a newly-elected Afghan government and its army were ready to take charge of security as the bulk of the international force departs by the end of the month.
"As difficult, as challenging, as long as this has been -- by any definition, the country of Afghanistan, the people of Afghanistan are far better off today than they were 13 years ago," Hagel told reporters on his plane.
The advances had come as a result of the "blood and treasure" spent by American, allied and Afghan troops, he added.
Hagel, who is shortly to step down from office, will meet with President Ashraf Ghani as well as senior US commanders and some US troops who are still deployed in the country.
Also Read
NATO's combat mission ends on December 31, and will be replaced by a US-led support mission of about 12,500 soldiers who will provide training and assistance for the Afghan security forces, as well as undertaking counter-terrorism operations.
Concern is growing for national stability as the US military presence declines, with the Afghan army and police enduring record casualties in battle this year and a series of high-profile Taliban attacks in Kabul.
President Barack Obama yesterday named Ashton Carter, a technocrat and academic with long experience working in the Pentagon, to replace Hagel as defence secretary.
Hagel, who took office in February 2013, resigned last month, rejecting accounts that he was forced out and saying it was a mutual agreement with the president.