"On that day, Canada will recognize those who fought, remember those who fell and salute all who contributed," the prime minister said as he welcomed home the last 93 soldiers.
"We will stand together and honour the strength of our men and women in uniform, we will honour the strength of the Canadian families who faced heart-wrenching loss, (and) we will honour the strength of our communities that supported them."
For some in the welcoming crowd, the homecoming had a sombre note.
Gail and Mark Freeman, whose son, Pte. Michael Freeman, was killed in Afghanistan on Dec. 26, 2008, drove to the morning ceremony from Peterborough, Ont.
"We just want to be here to support them," Gail Freeman said as she fought back tears.
"We lost our son in 2008 and we never got to go to a homecoming this way, and we wanted to make sure that we were here today."
"We're really grateful for them. We still feel that we're part of their family as well as they're still part of ours, too."
The final contingent of troops from Afghanistan flew in to Ottawa aboard a C-17 transport plane, escorted by a pair of CF-18 fighter jets.
The soldiers filed off the plane to a receiving line that included Harper, Gov. Gen. David Johnston and Gen. Tom Lawson, the chief of the defence staff.
They then moved into a cavernous hangar to hugs and kisses from loved ones and a hearty greeting from Johnston, who praised them as "ambassadors, peacekeepers, protectors and rebuilders of civil society."
"Welcome, home," Johnston said.
Harper echoed that sentiment: "All Canadians join with me to say welcome home and job well done."
The Canadians formally lowered their flag in Kabul last week, marking the end of a mission that began with the deployment of a handful of special forces soldiers in late 2001. Since then, thousands of Canadian soldiers rotated through Afghanistan in what Harper called "the longest active military engagement in Canadian history."
They fought pitched battles against the Taliban and braved the ever-present threat of improvised explosive devices, or IEDs, while trying to build schools, roads and other infrastructure in the perilous southern province of Kandahar.
In addition to the 158 members of the Canadian military who died in Afghanistan since 2002, a Canadian diplomat, a journalist and two civilian contractors were also killed.
Following the end of the combat mission in 2011, a contingent of Canadian soldiers were assigned to the capital city of Kabul to assist in training members of the Afghan military.
As they arrived, many of the soldiers and their families were already reflecting on the mission and their hopes for what it will eventually mean for the future of Afghanistan.
Brig.-Gen. Todd Balfe, who spent the last 10 months in the Afghan capital, said he was confident that Afghanistan is strong enough now to turn back a Taliban resurgence.
"Five years ago there were only a few thousand Afghan national security forces," said Balfe, his wife Chantal and their two boys, Jake and Nick, glued to his side.
"Today there are 352,000 members of the Afghan National Army and the Afghan National Police. That's remarkable . . . and tens of thousands of them were trained by Canadians."
Balfe's words were a comfort for Gail Freeman, who hoped that Afghanistan would not return to the way it was under the Taliban, if for nothing more than her son's legacy.
"I pray that things don't go back the way they were," she said, referring to the Taliban rule of Afghanistan before Canadian and other NATO troops entered the war-ravaged country.
"If it does, (my son) will have died in vain."
Also on HuffPost