KABUL, AFGHANISTAN — Afghan forces have taken over the lead from the U.S.-led NATO coalition for security nationwide, President Hamid Karzai announced Tuesday in a significant milestone in the 12-year war.

The announcement came amid a grim reminder of Afghanistan’s daily violence. A few miles from where Karzai was speaking a bomb targeted a prominent lawmaker, missed him but killed three civilians.

In another key announcement, Karzai said he will soon send representatives to the Gulf state of Qatar to discuss peace with the Taliban. The talks in Doha would follow the planned opening of a Taliban political office in the Arab country.

The handover of responsibility marks a turning point for American and NATO military forces, which will now move entirely into a supporting role. It also opens the way for their full withdrawal in 18 months.

“This is a historic moment for our country and from tomorrow all of the security operations will be in the hands of the Afghan security forces,” Karzai said at the ceremony, held at the new National Defense University built to train Afghanistan’s future military officers.

“This is a historic moment for our country and from tomorrow all of the security operations will be in the hands of the Afghan security forces,” Karzai said at the ceremony, held at the new National Defense University built to train Afghanistan’s future military officers.

On the ground, this means U.S. and other foreign combat troops will not be directly carrying the fight to the insurgency, but will advise and back up as needed with air support and medical evacuations.

The transition also comes at a time when violence is at levels matching the worst in 12 years, fueling some Afghans’ concerns that their forces aren’t ready.

Karzai said that in the coming months, coalition forces will gradually withdraw from Afghanistan’s provinces as the country’s security forces replace them.

In announcing the fifth and final phase of a process that began at a November 2010 NATO summit in Lisbon, Portugal, Karzai said “transition will be completed and Afghan security forces will lead and conduct all operations.”

He also said he would send representatives of his High Peace Council to Doha for meetings with Taliban representatives once their office is open.

“We are hopeful that if the opening of the office is today or if tomorrow the negotiation for peace starts sooner between the High Peace Council and the Taliban,” Karzai told reporters after the ceremony.

Karzai visited Qatar last week and discussed his country’s stalled peace process and the possible opening of the Taliban office. Both Afghanistan and the United States support the opening as part of an effort to rekindle talks with the insurgent group. But first, Kabul and Washington say, the Taliban must renounce all ties to al-Qaida and other terrorist groups and accept Afghanistan’s constitution.

“We are hopeful that after starting negotiations in Qatar, immediately the negotiations and all peace process should move into Afghanistan. Afghanistan shouldn’t be center of the discussions outside of the country,” Karzai said.

The Taliban have for years refused to speak to the government or the Peace Council, set up by Karzai three years ago, because they considered them to be American “puppets.” Taliban representatives have instead talked to American and other Western officials in Doha and other places, mostly in Europe.

But there are indications the Taliban sent a message to Karzai late last month through the United States that they were now willing to talk to the peace council, and that American officials were trying to find ways to facilitate how the talks would take place.

“We don’t have any immediate preconditions for talks between the Afghan peace council and the Taliban, but we have principles laid down,” Karzai said, adding that they include bringing an end to violence and for talks to be moved to Afghanistan so they are not exploited by other countries.

Karzai also lauded the work of NATO to help Afghan forces reach the point where his military is ready to take responsibility for the country’s security.

“This has been one of my greatest desires and pursuits. And I’m glad that I as an Afghan citizen and president have reached this objective today. To have the Afghan forces in command of themselves and in service of the country,” Karzai said.

NATO Secretary-General Anders Fogh Rasmussen said the coalition will help militarily if and when needed but will no longer plan, execute or lead operations.

Alliance training since 2009 dramatically increased the size of the Afghan National Security Forces, bringing them up from 40,000 men and women six years ago to about 352,000 today. After transition, coalition troops will move entirely into a supporting role — training and mentoring, and in emergency situations providing the Afghans backup in combat, mainly in the form of airstrikes and medical evacuation.

“Ten years ago, there were no Afghan national security forces. Five years ago, Afghan forces were a fraction of what they are today. Now you have 350,000 Afghan troops and police. A formidable force. And time and again, we have seen them dealing quickly and competently with complex attacks. Defeating the enemies of Afghanistan, and defending and protecting the Afghan people,” Fogh Rasmussen said.

Afghans will now have the lead for security in all 403 districts of Afghanistan’s 34 provinces. Until now, they were responsible for 312 districts nationwide, where 80 percent of Afghanistan’s population of nearly 30 million lives. Afghan security forces were until now carrying out 90 percent of military operations around the country.

Foreign forces will continue to support Afghans on the battlefield when they require it, but the Afghan army and police will be responsible for planning and leading military operations against the insurgency.

“As your forces step forward across the country, the main effort of our forces is shifting from combat to support. We will continue to help Afghan troops in operations if needed. But we will no longer plan, execute or lead those operations. And by the end of 2014, our combat mission will be completed. At that time, Afghanistan will be fully secured by Afghans,” Fogh Rasmussen said.

The handover paves the way for coalition forces — currently numbering about 100,000 troops from 48 countries, including 66,000 Americans — to leave. By the end of the year, the NATO force will be halved. At the end of 2014, all combat troops will have left and will replaced, if approved by the Afghan government, by a much smaller force that will only train and advise.

President Barack Obama has not yet said how many soldiers he will leave in Afghanistan along with NATO forces, but it is thought that it would be about 9,000 U.S. troops and about 6,000 from its allies.

“From 2015, a new chapter will begin. We need to sustain, and build on, the progress we have made. And NATO is ready to play its part, Fogh Rasmussen said.

Called “Resolute Support,” Fogh Rasmussen said the goal of the new mission “is to train, advise and assist Afghan forces.”

“Afghanistan does not stand alone, now or in the future,” he added.

The U.S. and its allies have already pledged to fund the Afghan forces in the immediate years after 2015.

Miles from Tuesday’s ceremony, a bomb attack targeted Afghan politician Mohammed Mohaqiq, a prominent ethnic Hazara lawmaker who is a former Cabinet member. He escaped the assassination attempt but the explosion killed three civilians, the police said.