CAMP DAVID, Maryland (AP) — In a show of unity, U.S. and Afghan officials laid the groundwork for new relations between the two countries on Monday, including plans to seek American funding to maintain an Afghan security force of 352,000 and long-term counterterrorism efforts. Discussions over future U.S. troop levels continue as the war winds down.

In an all-day session at the Camp David presidential retreat in Maryland's Catoctin mountains, dozens of U.S. and Afghan officials, including Secretary of State John Kerry, Defense Secretary Ash Carter, Afghan President Ashraf Ghani and chief executive Abdullah Abdullah gathered to relaunch a relationship strained by nearly 14-years of war and often-testy relations with former Afghan President Hamid Karzai.

During the meeting, the U.S. agreed to seek funding through 2017 for an Afghan force of 352,000, a level the nation has yet to meet, Carter said. U.S. officials said the Afghan government is trying to improve recruiting to make up for security forces who leave the service.

They also agreed to require the Afghan government to complete specific reforms and meet other milestones in order to receive up to $800 million. U.S. officials said the Afghans suggested the incentive-based funding idea. The leaders of the two nations also said they would restart routine ministerial-level Defense and State Department meetings.

Ghani is to meet with President Barack Obama on Tuesday, an engagement during which officials expect the U.S. to make clear its decision to slow the pace of the withdrawal of American troops from Afghanistan. Ghani and Abdullah fought a contentious election last year to replace Karzai, and their power-sharing agreement was lauded by Kerry, who played a key role in brokering it.

"It is easy today to underestimate the measure of courage and leadership and selflessness that was demanded at that moment, and that both of these leaders continue to show in their commitment to a unity government," Kerry said.

He added that "huge challenges remain" but that the agreements to be reached this week will help pave the way for stability and security. Kerry said that the joint appearance at Camp David, along with the White House meetings, should serve as notice to the Taliban that the U.S.-Afghan relationship is back on track and they should negotiate rather than fight.

"All of these underscore to any Taliban, to anybody who wants to engage in violence that we are prepared in the long term to support our friends in Afghanistan," Kerry said.

Obama has promised to pull remaining U.S. troops out by the end of his presidency. But deficiencies in the Afghan security forces, heavy casualties in the ranks of the Afghan army and police, a fragile new government and fears that Islamic State fighters could gain a foothold in Afghanistan have combined to persuade Obama to slow the withdrawal.

Instead of trimming the current U.S. force of 9,800 to 5,500 by the end of this year, U.S. officials say the administration now might keep many of them there well into 2016. Obama has said that after that, the U.S. will maintain only an embassy-based security force in Kabul of perhaps 1,000 troops.

Ghani, who has expressed worries about Islamic State militants trying to gain a foothold in his country, has pressed to keep more U.S. troops there longer, but Obama has promised to end both wars in Afghanistan before his presidency ends in January 2017.

Both Carter and Kerry acknowledged the importance of the U.S continuing its counterterrorism missions in Afghanistan, even into 2017.

Kerry said the U.S. is concerned about reports that Islamic State militants are recruiting in Afghanistan and that some Taliban are rebranding themselves as Islamic State members.

He said the U.S. will continue to maintain a counterterrorism effort that is "focused on al-Qaida at this moment" but would also have the ability to assist the Afghan forces as they provide security for their nation.

During a visit to the Pentagon earlier Monday, Ghani thanked U.S. troops and taxpayers for their sacrifices in nearly 14 years of war. He pledged that his impoverished country will not remain a burden to the West.

"We do not now ask what the United States can do for us," Ghani said. "We want to say what Afghanistan will do for itself and for the world," he added.

On arrival at Camp David, Ghani emphasized what he called a new phase of the U.S.-Afghan relationship.

"It's time for Afghanistan to reciprocate the gift that the United States has so generously provided over the years," he said. "Reciprocating the gift means owning our problems, solving them and asking of ourselves what we must do for ourselves and for the region."

Ghani's relationship with Washington stands in stark contrast to that of his predecessor, Karzai, whose antagonism toward the U.S. culminated in a refusal to sign security agreements with Washington and NATO before leaving office last year. Ghani signed the pacts within days of becoming president in September, and he has since enjoyed a close relationship with American diplomats and military leaders.

___

AP National Security Writer Robert Burns and AP Radio correspondent Sagar Meghani contributed to this report.