BAGHDAD- Iraq's national security adviser said on Thursday that U.S.-led forces had ended their combat mission in Iraq, a move that transfers all remaining troops into a training and advising role.

Qasim al-Aaraji said on Twitter that the combat mission had ended on schedule ahead of the end of the year and that combat troops were to withdraw.

U.S. President Joe Biden and Iraqi Prime Minister Mustafa al-Kadhimi sealed an agreement in July to formally end the U.S. combat mission in Iraq by the end of 2021.

Western security and diplomatic officials say that calling the shift a withdrawal is misleading because it changes little in terms of the number of forces based in Iraq.

The U.S. has kept around 2,500 troops in Iraq since 2020. The Western officials say that most of those forces have been operating only in a training and advising role for some time.

The U.S.-led military mission focuses on countering the remnants of Islamic State. It began its mission in 2014 as part of an international effort to defeat the extremist group which had taken over vast areas of Iraq and Syria.

(Reporting by Ahmed Rasheed and John Davison, additional reporting by Enas Alashray in Dubai; Writing by John Davison) ((Nadine.Awadalla@thomsonreuters.com;))