The desert sun beat down on the U.S., British and Afghan troops gathered at Camp Leatherneck in Helmand province in southern Afghanistan. The Marines rolled up their flag as it came down, along with the NATO and British banners.

With the ceremony on Sunday, the Afghan army is now in command of Camp Leatherneck and neighboring Camp Bastion, the former British base.

As the U.S. military presence winds down in Afghanistan, this was by far the biggest transfer yet, and it marked the end of a Marine mission here that began in 2009. At the time, British forces were in charge of Helmand province, but they weren't able to subdue the Taliban. So the U.S. sent in the Marines, and at the peak, 20,000 of them were battling the Taliban in this part of the country.

The Taliban haven't been defeated in Helmand, and the departure of the Marines raises questions about whether the Afghan army will be able to fend off the Taliban.

"This transfer is a sign of progress," said Brig. Gen. Daniel Yoo, the last commander of Regional Command Southwest, which is now effectively dissolved. Closing out this mission is a personal bookend for him. He was a Marine lieutenant colonel in the force that stormed into southern Afghanistan in 2001.

Between then and now, more than 350 Marines died in Helmand province. In addition, more than 450 British troops were killed fighting here.

"And they will always be in our thoughts and hearts," said Yoo.

The U.S. still has around some 20,000 military personnel in Afghanistan, including a small Army base in Helmand province that is expected to remain for a few more months.

However, the American combat mission throughout Afghanistan is set to conclude by the year's end after more than 13 years of war. The U.S. and Afghanistan recently signed a security agreement that calls for the U.S. to keep nearly 10,000 troops in Afghanistan over the next two years to help the Afghan forces and conduct counterterrorism operations.

After Sunday's ceremony, some of the Marines headed straight to the airfield, others went to finish packing, and a few manned the guard towers for their last watch.

Lance Cpl. Javonte James, with 3rd Platoon of Alpha Company of the 1-2 Marines out of Camp Lejeune, N.C., said it was a great honor to be part of the last Marine unit in Helmand.

"We're worn out. But at the same time, the war is over, it's time to go home," he said.

He said he had faith in the Afghan army, which is facing a tough fight in Helmand. The Taliban have inflicted heavy casualties this year on Afghan forces, who have lost nearly as many troops in 2014 as NATO has lost in the province since 2001.

Looking out the tower, James says he's shocked how quickly the base was torn down.

"One minute you see a building, and the next it's gone," he said.

This base once housed more than 40,000 personnel. It was a small city. The last time I was here in 2013 the base was still bustling with thousands of troops and contractors.

Now, it looks like something out of a post-apocalyptic zombie movie. There is an eerie stillness. The only sounds are generators humming in the distance and the sound of fighter jets circling overhead. They are providing security, now that the base's surveillance hardware has been dismantled.

As far as you can see, there are empty buildings and razor wire fences surrounding vast expanses of nothingness.

As the Marines prepared to depart, a convoy pulled out of the adjoining Afghan base. The Afghans followed Alpha Company along the base perimeter. At each tower, two Afghans got out and replaced the Marines on duty.

They quickly shook hands, the Marines wished their replacements well, and then they headed to the flight line.

Over the next few hours, Marines squeezed themselves into a variety of helicopters and C-130 cargo planes.

There are no seats in the planes. The troops sat on their backpacks in the cargo bay for the flight to Kandahar. One looming question: What would come next for the Marines?

Capt. Joseph Wiese served in Iraq in 2009 and helped the Marines transition from that war to Afghanistan.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.