BAGHDAD (AP) — For the first time, Iraqi troops trained by the U.S.-led coalition have been added to the assault force Iraq is using to retake the city of Ramadi, a U.S. military official said Thursday.

The news that about 3,000 U.S.-trained Iraqi army soldiers were added to the fight in recent days was disclosed to U.S. Defense Secretary Ash Carter, who spent the day getting updates and meeting with U.S. and Iraqi officials and commanders in Baghdad. It was Carter's first visit to Iraq since he took office in February.

The visit comes at an important moment for the Iraqi government just before the counteroffensive on Ramadi. The actual assault on the city has not yet begun, but a Pentagon spokesman, Army Col. Steve Warren, said it could start within several weeks.

The Ramadi campaign will be a crucial test not only for the Iraqi government led by Prime Minister Haider al-Abadi, but also for the U.S. strategy of relying on Iraqi security forces, operating in coordination with U.S.-led coalition airstrikes, to overcome the smaller Islamic State forces.

President Barack Obama has opted not to commit U.S. ground combat forces to Iraq, saying the only lasting solution is for Iraq to fight for itself.

Warren said the Pentagon chief was told that two Iraqi army brigades totaling about 3,000 soldiers joined the Ramadi counteroffensive within the past three days to five days. "This is a development we are very satisfied to hear," Warren said.

He said one of those newly trained units advanced about 4 miles toward Ramadi within the last 24 hours.

Warren said U.S. officials received Iraqi battlefield reports that say Iraqi forces have advanced to or near Anbar University in Ramadi. But he said the U.S. has no independent confirmation of that.

In addition to the 3,000 newly trained Iraqi soldiers now operating in the Ramadi area, about 500 Sunni Arab tribal fighters have also recently joined the advancing force, Warren said.

The Iraqi government intends to exclude all Shiite militias from the Ramadi operation, even those said to be under control of the Iraqi government — a key move toward getting the troops to work together effectively.

In a photo opportunity with Carter, al-Abadi noted the recent delivery of Iraq's first F-16 fighter jets from the U.S. as a sign of the value of U.S.-Iraqi relations. But he made it clear the battle against IS was Iraq's.

"It is Iraqi forces that are fighting on the ground and that are liberating remaining territory from Daesh," he said, using the Arabic acronym for the Islamic State group.

Carter visited the Iraqi Counterterrorism Service Academy, where he watched Iraqi soldiers maneuver and fire at silhouette targets at a range. Some soldiers wore partial or full face masks.

"Your forces have performed so very well, so very bravely," Carter told them. "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."

The Iraqi troops advancing on Anbar and others are being trained by the approximately 3,360 troops now in Iraq who are also advising Iraqi commanders on battle plans, and providing security for U.S. personnel and facilities. The U.S., joined by several coalition partners, also is conducting airstrikes daily to chip away at IS' grip on large parts of Iraq.

American military leaders have said they would recommend to Obama that he approve moving U.S. military advisers and perhaps special operations forces closer to the front lines if they believed it would make a decisive difference at certain stages of the Iraqi campaign.

Warren said they have not done so yet.

Obama's critics in Congress complain that he is missing an opportunity to swiftly defeat the Islamic State by not sending U.S. ground combat troops or at least placing military advisers with Iraqi units to make them more effective.

After Iraqi troops abandoned Ramadi in early May, handing IS its biggest battlefield victory of 2015, Carter caused a stir when he said Iraq's army "just showed no will to fight." That frank assessment exposed a central Iraqi weakness born of the country's sectarian split.

Carter noted that the Iraqi forces abandoned their weapons and equipment, including dozens of American-supplied tanks, armored fighting vehicles and artillery pieces, even though they outnumbered IS fighters. They became part of the IS arsenal and were then targeted in U.S. airstrikes.

A U.S. official noted that comment didn't come up between Carter and al-Abadi.

IS will again be outnumbered when, as expected, the Iraqi army makes a renewed assault on Ramadi. Warren said there are between 1,000 and 2,000 Islamic State fighters in Ramadi and "several thousand" Iraqi troops in the area now.

The loss of Ramadi was a major setback for Iraq, not just for the territory given up but for the psychological blow it inflicted on the security forces, whose confidence already was low.

It also meant a delay in the push to retake a city of even greater strategic importance, Mosul in northern Iraq. Mosul has been in IS hands since June 2014.

When Carter became Pentagon chief in February, U.S. military officials were talking about hoping the Iraqis would march on the city by May. Those hopes had faded even before Ramadi fell. Still, the current focus on recapturing Ramadi eventually will have to shift to Mosul and other parts of western and northern Iraq if Obama's vision of empowering a unified Iraq is to become reality.