"We'll stand by," Gates said. "We're ready to have that discussion if and when they want to raise it with us."
Gates urged Iraq's squabbling political groups to reconcile after eight months of deadlock. Any request to extend the U.S. military presence in Iraq would have to come from a functioning Iraqi government. It would amend the current agreement under which U.S. troops must leave by the end of 2011.
"That initiative clearly needs to come from the Iraqis; we are open to discussing it," Gates said.
U.S. and Iraqi officials have said for months they expect Iraqi leaders to eventually ask for an extension of the military agreement with the U.S., but the political impasse has put the idea on hold.
A spike in violence in Iraq over the past two weeks has underscored the continued potency of al Qaeda and other Sunni extremists.
"We have been pretty clear to the Iraqis that what we seek, and hope they will come together on, is an inclusive government that represents all of the major elements of Iraqi society and in a nonsectarian way," Gates said. "It is our hope that that is the direction they are moving in."
He spoke following a meeting with Malaysian Defense Minister Ahmad Zahid Hamidi.
Leaders of Iraq's major political blocs met Monday for the first time since parliamentary elections in March. The 90-minute televised session, the start of three days of talks, did not lead to a breakthrough.
The battle is largely a contest between the Iranian-favored coalition of Shiite Prime Minister Nouri al-Maliki and followers of anti-American cleric Muqtada al-Sadr against a Sunni-backed secular coalition led by former Prime Minister Ayad Allawi.
At stake is whether Iraq has an inclusive government of both the majority Shiites and the minority Sunnis, or a Shiite-dominated government with the Sunnis largely in opposition - a recipe that many worry will turn the country back to the sectarian violence of a few years ago.
Al-Maliki's bloc won 89 seats in the March 7 election, compared with 91 for Allawi's coalition; neither side won the majority of seats needed to govern.
Gates said he has not spoken directly to any of the political leaders, but other U.S. officials, including Vice President Joe Biden, have been heavily engaged.
Gates predicted a new government would need some time before asking the U.S. to extend the troop plan.
Although the 2011 deadline was a point of pride for Iraq after years of U.S. military occupation, it does not leave much time for the U.S. to train Iraq's fledgling air force. Iraq also wants more U.S. help to protect its borders.
By AP National Security Writer Anne Gearan