U.S. Defense Secretary Ash Carter has stressed to Iraqi leaders the desire of the United States and its coalition partners to "accelerate" efforts to defeat the Islamic State group.

Carter met with Iraqi Prime Minister Haider al-Abadi and Defense Minister Khaled al-Obaidi after making an unannounced visit Wednesday to Baghdad as part of a trip to seek more help in the battle against IS.

Carter told reporters he discussed with both men the importance of building on their success to "complete the recapture of Ramadi, and then continue the campaign with an important goal of retaking Mosul as soon as possible."

"The United States is willing to do more in association to support the Iraqi security forces in that mission," said Carter.

Secretary Carter also held talks with General Sean MacFarland, U.S. commander of the fight against IS in Syria and Iraq, about speeding up the campaign to defeat the terrorist group.

The U.S. has been supporting Iraqi forces with airstrikes since August of last year, but has so far ruled out sending ground troops beyond a limited force. Islamic State fighters still control large areas in northern and western Iraq, including several major cities. Previous efforts to retake Mosul and Ramadi have stalled.

Carter's stop in Iraq follows his visit to Turkey, where he urged more Turkish air and ground support for the U.S.-led coalition and pressed Turkey to better secure its border to help prevent fighters from going into Syria.​

He also welcomed Saudi Arabia's announcement of a new 34-nation Islamic military alliance to fight terrorism.

"It appears that it's very much aligned with something we've been urging for quite some time, which is greater involvement in the campaign to combat ISIL by Sunni Arab countries," Carter said, using an acronym for Islamic State. "I, and others, have been consistently urging Saudi Arabia and other states to be more active in the campaign to defeat ISIL because obviously they have, being from the region, a better ability than we will have to promote what we know is necessary for the defeat of ISIL in Iraq and Syria."

Saudi Foreign Minister Adel al-Jubeir did not rule out sending ground troops as part of alliance efforts. He said assistance would be provided on a case-by-case basis and that there was "no limit" on where it would be sent.