WARSAW, Poland — NATO allies agreed Saturday to provide increased military support to countries in the Middle East and North Africa that are targets of Islamic extremism, including using NATO surveillance planes in the fight against the Islamic State group.

Alliance leaders also agreed to launch a new naval mission in the Mediterranean, and made commitments to maintain a stable military presence in Afghanistan and to fund Afghan security forces through 2020.

“We’re moving forward with the most significant reinforcement of our collective defense any time since the Cold War,” President Obama said at a news conference at the end of a crucial NATO summit in Warsaw.

NATO Secretary-General Jens Stoltenberg said NATO will start a training and capacity-building mission for Iraqi armed forces in Iraq, a country he called central in the fight against the Islamic State group, which is also known as ISIS or ISIL. NATO is also working to establish an intelligence center in Tunisia, a major recruiting ground for the extremist group, and will shortly start providing support to Tunisian special operation forces.

“Today we have taken decisions to strengthen our partners and to project stability beyond our borders,” Stoltenberg told reporters. He said millions of people in Africa and the Middle East have been rendered “homeless and helpless” by radical organizations like the Islamic State group and that the extremist groups are also to blame for organizing terrorist attacks in Europe and America.

Obama, who was attending his last NATO summit, called it “a pivotal moment for our alliance.”

“In nearly 70 years of NATO we have perhaps never faced such a range of challenges all at once – security, humanitarian, political,” he said. But he concluded that with the multifaceted efforts being made, “NATO is as strong, as nimble and as ready as ever.”

Stoltenberg said Obama and leaders of the other 27 NATO countries also agreed in principle for alliance surveillance aircraft to provide direct support to the U.S.-led coalition fighting the Islamic State in Syria and Iraq. NATO diplomats say they expect flights by alliance AWACS planes to begin this fall and Stoltenberg labeled the move “a clear signal of our resolve to help tackle terrorism.”

He said the alliance will launch a new maritime operation in the Mediterranean called Operation Sea Guardian, whose responsibilities will include counterterrorism. NATO will also cooperate with the European Union’s efforts to shut down human smuggling operations that have fueled Europe’s greatest migrant crisis since World War II.

The alliance will also increase cooperation with Jordan, and is preparing to help the new government in Libya design policies and institutions to help it better defend itself against extremist organizations, Stoltenberg said.

“We will provide greater support to our partners, so they can secure their countries and push back against violent extremism,” he said.

Obama had been urging his fellow NATO leaders in Warsaw to expand their support for the war in Afghanistan against the Taliban. Meanwhile, violence in the U.S. led him to cut his Europe trip short so he can return home Sunday.

The U.S. has pledged to provide $3.5 billion annually to fund Afghan forces, and the government in Kabul is expected to contribute as much as $500 million. Allies would provide the remaining $1 billion. The funding would maintain a total of 352,000 Afghan Army troops and police officers.

“We are very close and I am certain we will reach that (funding) level,” Stoltenberg told reporters. A senior U.S. administration official said NATO has commitments for about 90 percent of the goal.

Stoltenberg said it’s too soon to say exactly how many troops individual allies will agree to keep in Afghanistan under NATO’s Resolute Support training and advisory mission. But he said he believed that, based on commitments made Saturday, force levels will remain largely stable. Specific numbers will be finalized this fall, he said.

U.S. administration officials said they believe the number of forces dedicated to the NATO mission will be a bit more than 12,000. The officials were not authorized to discuss the details publicly, so spoke on condition of anonymity.

U.S. Army Gen. Curtis Scaparrotti, the NATO supreme commander, told reporters the U.S. has pledged about 6,700 of that total, about 200 fewer than it currently provides.

Earlier this week, Obama announced that overall he would keep 8,400 U.S. troops in Afghanistan, rather than cut their numbers to 5,500 as he once planned.