The U.S. military is planning to reposition hundreds of troops in Iraq, including moving some out of the country, according to three U.S. defense officials.

The consolidation of forces will include removing U.S. troops from joint bases at al-Qaim near the Syrian border, Qayyarah Airfield West near Mosul and possibly K-1 Air Base in Kirkuk.

"As a result of the success of Iraqi Security Forces in their fight against ISIS, the Coalition is re-positioning troops from a few smaller bases," a spokesperson for Operation Inherent Resolve said in a statement. "These bases remain under Iraqi control and we will continue our advising partnership for the permanent defeat of Daesh from other Iraqi military bases." ("Daesh" is a name the U.S. military uses for the Islamic State terrorist group, also known as ISIS.)

The spokesperson said the military would not announce a specific timetable for the troop movements.

Download the NBC News app for breaking news and politics

The decision comes as the U.S. has begun moving in additional air defenses to protect coalition troops at Ain al Asad Air Base and Irbil Air Base in the north, systems that require additional troops to set up, operate and maintain.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The U.S. has already moved C-RAMs, or counter rocket, artillery and mortar systems, into Iraq and plans to move in Patriot batteries in the coming days. Both systems will be operational in the next week or two, according to a defense official.

The Patriots are intended to defend against ballistic missiles, like those Iran fired at Ain al Asad and Irbil in January. The C-RAMs can defend against smaller incoming fire, like the 107 mm Katyusha rockets fired at Camp Taji, Iraq, on Wednesday evening, killing two American service members and a British medic. Twenty-five rockets also hit Camp Taji on Saturday, wounding three American service members and two Iraqis.

The C-RAMs are primarily used to defend the Patriot systems, which will become potential targets, according to Marine Gen. Frank McKenzie, commander of U.S. Central Command.

A defense official said the decision to consolidate troops in Iraq is not related to the rocket attacks at Camp Taji last week but has been under consideration for several months as the U.S. military mission in Iraq evolves and the Iraqi security forces become more capable of maintaining security on their own.

The Iraqi Counter Terrorism Service has made "significant progress" and can handle many of the counter-ISIS missions on its own, according to one defense official.

Another factor in the decision to consolidate bases is that it is harder to defend small numbers of American forces spread out at smaller installations. The base at Irbil is more hardened and will soon have Patriots and C-RAMs, additional security for troops who could move there. Some troops at al-Qaim could move to Ain al Asad.

The defense officials said that even with several hundred troops leaving the bases, the overall number of U.S. troops in Iraq will stay at about the same. Some troops will reposition in the country, and the influx of troops to operate the Patriots and the C-RAMs will keep the overall number about the same.

The Pentagon says there are roughly 5,200 U.S. military personnel in Iraq, but the actual number has been much higher since tensions were elevated in early January, at times with several thousand more U.S. service members in Iraq.

After protesters tried to storm the U.S. Embassy in Baghdad in late December and the U.S. killed Iranian Maj. Gen. Qassem Soleimani in January, the U.S. military moved thousands of additional soldiers and Marines into Iraq and the region to defend installations and diplomatic facilities. Once the Patriots and the C-RAMs are in place, some of those troops can deploy to other areas or leave Iraq altogether.

The U.S. military is also looking at troops at Al Taqaddum Air Base west of Baghdad as a possible location to draw out of later this year.

The military is also considering changing the overall structure of Combined Joint Task Force Operation Inherent Resolve from a three-star billet to a two-star command, putting a major general in charge rather than a lieutenant general. But the defense officials believe that if that decision is made, it will not happen for months.