U.S. Defense Secretary Ash Carter arrived in an unannounced visit to Baghdad on Thursday, his first visit to Iraq since he took office in February.

Carter is expected to talk with Iraqi officials about the Iraqi army's coming attempt to recapture the key city of Ramadi from the Islamic State, as well as make an assessment of how much progress the Iraqi government has made in resolving the country's sectarian divisions.

The Iraqi Counterterrorism Service Academy was Carter's first stop during the day-long visit to the Iraqi capital.

"Your forces have performed so very well, so very bravely," Carter told the Iraqi counterterrorism commanders. "And I know that you have suffered great losses too, but I just wanted to tell you that it is very clear to us in Washington what a capable force this is. So it's a privilege for us to be your partners."

Carter was at the Academy for about 20 minutes, watching Iraqi soldiers perform maneuvers and fire at silhouette targets at a firing range, according to Military.com.

There are currently about 3,360 U.S. troops in Iraq. The troops are detailed to providing security for U.S. personnel and facilities, training Iraqi troops and advising Iraqi commanders on battle plans. Carter is not scheduled to announce any major change in U.S. strategy or increase in U.S. troop levels, Army Times reported.

In spite of this, the visit comes at a key moment for the Iraqis, who are working out a counteroffensive to retake Ramadi, the capital of Anbar province from ISIS, according to ABC News. The campaign to retake Ramadi will be a test for the Iraqi government, led by Prime Minister Haider al-Abadi, as well as for President Obama, whose strategy has been not to commit U.S. ground combat forces to Iraq, saying the only lasting solution is for Iraq to fight for itself. Gen. Martin Dempsey, chairman of the Joint Chiefs of Staff, supports Obama's approach.

Carter had famously said that the Iraqi Army "just showed no will to fight," after Iraqi troops abandoned Ramadi in early May, giving the Islamic State its biggest battlefield victory of 2015, The Economic Times reported.