WASHINGTON >> The U.S. Army is slashing the size of its force by about 24,000, or almost 5%, and restructuring to be better able to fight the next major war, as the service struggles with recruiting shortfalls that made it impossible to bring in enough soldiers to fill all the jobs.

The cuts will mainly be in already-empty posts — not actual soldiers — including in jobs related to counterinsurgency that swelled during the Iraq and Afghanistan wars but are not needed as much today. About 3,000 of the cuts would come from Army special operations forces.

At the same time, however, the plan will add about 7,500 troops in other critical missions, including air-defense and counter-drone units and five new task forces around the world with enhanced cyber, intelligence and long-range strike capabilities.

Army Secretary Christine Wormuth said she and Gen. Randy George, the Army chief, worked to thin out the number of places where they had empty or excess slots.

“We’re moving away from counterterrorism and counterinsurgency. We want to be postured for large-scale combat operations,” Wormuth told reporters on Tuesday. “So we looked at where were there pieces of force structure that were probably more associated with counterinsurgency, for example, that we don’t need anymore.”

George added that Army leaders did a lot of analysis to choose the places to cut.

“The things that we want to not have in our formation are actually things that we don’t think are going to make us successful on the battlefield going forward,” he said.

According to an Army document, the service is “significantly overstructured” and there aren’t enough soldiers to fill existing units. The cuts, it said, are “spaces” not “faces” and the Army will not be asking soldiers to leave the force.

Instead, the decision reflects the reality that for years the Army hasn’t been able to fill thousands of empty posts. While the Army as it’s currently structured can have up to 494,000 soldiers, the total number of active-duty soldiers right now is about 445,000. Under the new plan, the goal is to bring in enough troops over the next five years to reach a level of 470,000.

The planned overhaul comes after two decades of war in Iraq and Afghanistan that forced the Army to quickly and dramatically expand in order to fill the brigades sent to the battlefront. That included a massive counterinsurgency mission to battle al-Qaida, the Taliban and the Islamic State group.

Over time the military’s focus has shifted to great power competition from adversaries such as China and Russia, and threats from Iran and North Korea. And the war in Ukraine has shown the need for greater emphasis on air-defense systems and high-tech abilities both to use and counter airborne and sea-based drones.