Updated

President Bush and Iraq's president expressed cautious optimism Wednesday about prospects for completing a complex agreement that would keep U.S. troops in Iraq after a U.N. mandate expires at year-end.

Bush said the U.S. was working on an agreement that "suits" the Iraqi government. Iraqi President Jalal Talabani, speaking in the Oval Office after meeting with Bush, cited recent progress and said he hoped it could be finished "very soon."

U.S. and Iraqi authorities are trying to meet a July target date for completing the security agreement. Talks bogged down over several key issues, which Iraqi lawmakers said violated the nation's sovereignty. Recently, however, Iraqi authorities said prospects for a deal had brightened after the Americans submitted new, unspecified proposals.

"We talked about a strategic framework agreement that suits the Iraqi government," Bush said. "We talked about elections and different laws that have been passed. We talked about the fact that the economy's improving and that the attitude of the people there has improved immeasurably over the years."

Bush wants the agreement in place before he leaves office. If not, major decisions about how U.S. forces operate in Iraq could be left to the next president, including how much authority the U.S. must give Iraqis over military operations and how quickly the handover takes place.

"We are doing our best for this agreement -- strategic agreement with the United States of America," Talabani said. "I think we have very good, important steps toward reaching to finalize this agreement ... very soon."

Talabani also said he thinks the Iraqi government can pass oil and elections laws this year and has moved forward on normalizing relations with Iran and Syria and improving relations with Turkey, Egypt, Jordan and Kuwait.

He said he briefed Bush about Iraq's struggle against terrorism and militias threatening civil war.

"Now, I can say that Iraq -- a big part of Iraq is stable and is secured and separated from the danger of terrorism and militia," Talabani said. "Yes, some places ... there are some groups who remain here and there."