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.
"They have the ability to decide their own fate, their own way, on their terms. They're not completely there yet. But they've come a long way," he said.
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.
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.
About 130,000 NATO troops were fighting in Afghanistan in 2010 at the peak of the foreign intervention, after the fall of the Taliban regime in 2001.
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 on Friday named Ashton Carter, a technocrat and academic with long experience working in the Pentagon, to replace Hagel as defense 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.
After a prolonged crisis over a fraud-mired election, President Ghani came to power in September after signing a power-sharing deal with his poll rival Abdullah Abdullah.
Ghani this week attended a donor conference in London, stressing he would "do things differently" from his predecessor Hamid Karzai, who had troubled ties with Western countries.
"This transition from combat to non-combat is most welcome," he said of the NATO mission change.
Ghani, a former World Bank economist, also stressed his commitment to a peace process with insurgents, saying he believed that the withdrawal of foreign troops would "change the dynamic and the narrative" in Afghanistan.
The "national unity government" has struggled with negotiations over government positions, with no new ministers named more than two months after Ghani's inauguration in late September.
Hagel, who is on his last trip to Afghanistan, recalled that he first travelled to the country as a senator with a small delegation in January 2002, shortly after the US invasion that toppled the Taliban.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ