President Obama in Warsaw for his last NATO summit, which was overshadowed by violence and angry demonstrations at home. (Jonathan Ernst/Reuters)

President Obama, who had pledged to end America’s wars, described the landscape he was leaving to his successor as a state of quasi-war that could extend for years to come.

Obama, who was speaking Saturday to reporters at the NATO summit here, noted with pride that he has cut the size of the U.S. forces in Iraq and Afghanistan from 180,000 troops to fewer than 15,000.

But U.S. drones and fighter jets are striking targets in seven countries on a regular basis, a span of geography that is virtually unprecedented in American history outside of major wars. U.S. Special Operations forces are still conducting dangerous raids in countries such as Iraq, Afghanistan and Syria.

The president spoke forthrightly, and with a hint of frustration and regret, about the scope of the military campaign he is leaving behind.

“As commander in chief of the most powerful military in the world, I spend a lot of time brooding over these issues,” he said. “I am not satisfied that we have got it yet. I can say it is better than when I came into office.”

Obama was in Warsaw for his last NATO summit, which was overshadowed by violence and angry demonstrations at home in the wake of fatal shootings in Dallas, Baton Rouge and Falcon Heights, Minn.

He had been scheduled to return to Washington on Monday after two days in Spain, but he decided to curtail his trip and come back Sunday night because of the tragedies.

His last months in office will be dominated by the response to last week’s violence and the coming election.

Obama also said he will be working in his final months to leave behind “an architecture” for this new kind of military fight that mixes drone strikes with local training and efforts aimed at repairing fractured societies in Syria, Iraq and Afghanistan.

Such a position falls short of all-out war, Obama said. Instead, he called it “more of a hybrid approach” necessary to deal with “a different kind of low-grade threat — one that’s not an existential threat but can do real harm and real damage to our societies and creates the kind of fear that can cause division.”

As part of this effort, the White House earlier this month released a report on its drone program that concluded that between 64 and 116 civilians have been killed in the secret strikes over the past seven years.

Independent groups that track civilian deaths have produced far higher casualty rates. Obama acknowledged that the numbers were in dispute, but he described the report as an initial and imperfect effort by the government to hold itself accountable for its errors.

The drone report does not provide dates or locations for any of the strikes, making it impossible for outside groups to confirm the data.

“There is an arc of insecurity and instability along NATO’s periphery and beyond,” leaders of the 28 NATO nations said in a joint declaration at the end of the summit.

Obama said Saturday that NATO leaders had taken important steps to address security far beyond U.S. borders, with deployments to Eastern Europe to defend against Russia and to the Mediterranean to handle migrant flows, as well as an extension of the Afghanistan mission to bolster shaky security there.

“We’re moving forward with the most significant reinforcement of our collective defense any time since the Cold War,” Obama said. At the NATO summit, Obama announced plans for a U.S.-led battalion of about 1,000 troops that will deploy to Poland. Three other battalions will be sent to Estonia, Latvia and Lithuania.

As he heads toward his final months in office, Obama acknowledged a wide range of challenges to global security that will extend far into the future. The Islamic State’s territorial losses in Iraq and Syria in recent weeks could spur the group to launch global terrorist attacks, he said.

Obama praised the post-World War II legacy of NATO and other global institutions that have prevented wars between states and set off a period of unprecedented prosperity. He suggested that Britain’s decision to split from the European Union could hurt the global economy and said he was counseling Britain and the E.U. to split in a way that would cushion the economic blow.

Speaking of the legacy of global institutions such as the E.U., NATO and the United Nations, he said, “We should be proud of that and preserve it.”

But, he said, threats such as the Islamic State and al-Qaeda, which do not obey territorial bounds, could not be definitively defeated in traditional ways. Such groups guarantee that the United States will be waging at least low-level combat for years, possibly decades.

Because groups like the Islamic State are “non-state actors, it’s very hard for us ever to get the satisfaction of MacArthur and the emperor meeting and a war being officially over,” Obama said, referring to the U.S. general and Japanese leader at the end of World War II.