The US announced on Wednesday it will pull 11,800 troops from Germany, a hub for US operations in the Middle East and Africa.

The US will bring about 6,400 forces home and shift about 5,400 to other countries in Europe, US defense officials said, detailing a Pentagon plan that will cost billions of dollars and take years to complete.

The decision fulfills Trump’s announced desire to withdraw troops from Germany, at least in part due to its failure to spend enough on defense. US officials said that some moves will begin in months, and would likely send air and ground forces to countries that already have an American troop presence. The plan leaves about 25,000 troops in Germany.

The announcement is closely tied to the plan to increase the US troop presence in Poland, a shift long-desired by Warsaw and Polish President Andrzej Duda. The officials, who spoke on condition of anonymity to discuss plans not yet announced, said the moves will cost “billions” and require construction at bases in the US to accommodate the additional forces. The officials said that in the future other troops would rotate in and out of Europe.

Members of Trump’s own political party have criticized the troop move as a gift to Russia and a threat to US national security. Twenty-two Republicans on the House Armed Services Committee fired back with a letter to Trump saying a reduced US commitment to Europe’s defense would encourage Russian aggression and opportunism.

It’s also unclear if the plan would survive if Trump is not re-elected.

The decision to keep nearly half the forces in Europe, is a clear move by the Pentagon to assuage allies by avoiding the complete withdrawal of 10,000 troops out of the region. And by spreading forces into the east, it sends a message to Russia that the US is not reducing its commitment to region and remains ready to protect Eastern Europe from any Moscow aggression.

Sen. Jim Inhofe, the Republican chairman of the Senate Armed Services Committee, has voiced support for the plan, while also acknowledging it will take “months to plan, and years to execute.” He was briefed on the issue last week, and issued a statement saying the “concept for realigning US military posture in Europe” is sound.

Trump announced last month that he wanted to cut the number of active duty US troops in Germany from roughly 36,000 to a bit more than 25,000. Shifting forces out of the country had long been rumored and is in line with Pentagon efforts to put more troops in the Indo-Pacific.

Overall, the US has about 47,000 troops and civilian personnel in Germany, spread out across a number of bases, headquarters and smaller installations. Most of the 35,000 active-duty are in a handful of larger Army and Air Force bases including Ramstein Air Base, a hub in the region. There also are 2,600 National Guard and Reserve forces in Germany, and almost 12,000 civilians working for the services or the Defense Department.