BAGHDAD, Iraq (CNN) -- Sen. Barack Obama and Iraqi Prime Minister Nuri al-Maliki on Monday discussed a "general time horizon" for any American troop withdrawals from Iraq, al-Maliki's office said.



Sen. Barack Obama rides in a helicopter Monday with Gen. David Petraeus in Baghdad, Iraq.



Obama -- who has made ending the Iraq war a cornerstone of his run for office -- engaged in what were described as productive talks with al-Maliki during a trip to Iraq.



The Iraqi government has been pushing for the United States to set a general timetable to spell out troop withdrawals.



Iraqi Vice President Tariq al-Hashimi also met with Obama Monday and told reporters afterward they discussed the security agreement.



"I told Sen. Obama (that) Iraqi and American negotiations regarding this are ongoing, and today new Iraqi-American negotiations on this agreement have started with Iraqi written proposals and have a timetable for the withdrawal of U.S. troops from Iraq," he said.



The Bush administration has opposed timetables for troop withdrawals. But al-Maliki and President Bush last week agreed to a "general time horizon for meeting aspirational goals" on troop cuts.



The prime minister reiterated that principle with Obama, according to a statement from al-Maliki's office.



"Developments of the situation and the circumstances is what will decide the presence of foreign troops in Iraq, but without keeping open-ended dates," al-Maliki said, according to a statement from his office.



"With the developments on the ground, we can set a vision and clear horizons regarding this issue, and this is a view both sides agree on in the ongoing negotiations."



Al-Maliki's office quoted Obama as saying he is "supportive and committed to preserving the gains achieved by the Iraqi government" under al-Maliki's leadership and that he admires the prime minister's courage.



Obama has proposed withdrawing U.S. combat troops from Iraq within 16 months of taking office. Spokesman Ali al-Dabbagh said the Iraqi government's "vision" is that most U.S. combat troops would be out of Iraq by 2010. Asked if that stance is part of the current negotiations, al-Dabbagh said, "No. This is the Iraqi vision." iReport.com: Tell us the most important thing the next president needs to know about Iraq



A German magazine on Saturday quoted al-Maliki as saying he backed Obama's proposal, but al-Dabbagh has said that his remarks "were misunderstood, mistranslated and not conveyed accurately."



In a statement Sunday, the magazine, Der Spiegel, said it "stands by its version of this interview."



In the magazine interview, al-Maliki did not indicate that he was endorsing Obama over Sen. John McCain, the presumptive Republican nominee.



McCain does not think American troops should return to the United States until Iraqi forces are capable of maintaining a safe, democratic state. He has been a strong advocate of the "surge" -- the 2007 escalation of U.S. troops -- and has said troops should stay in Iraq as long as needed.



Louisiana Gov. Bobby Jindal -- who's been mentioned as a possible vice presidential pick for McCain -- on Monday criticized Obama's push to remove troops in 16 months as an "arbitrary timetable based on politics versus a plan based on the actual results on the ground."



"One of the reasons I'm supporting [McCain] -- he has made it clear he would rather lose an election than lose a war. He's made it very clear -- let's listen to the commanders on the ground," Jindal said on CNN's "American Morning."



McCain last week chided Obama for laying out his plans for Iraq and Afghanistan before talking to Gen. David Petraeus, the head of U.S. troops in Iraq.



Obama met with Petraeus and Ryan Crocker, the U.S. ambassador to Iraq, in Baghdad on Monday.



He also met with Tariq al-Hashimi, a Sunni Arab who is one of Iraq's two vice presidents; Lt. Gen. Lloyd Austin, commander of Multi-National Corps-Iraq;
who is going with obama who is going to be at the talks
Gen. David Petraeus Sen. Barack Obama and Iraqi Prime Minister Nuri al-Maliki
question: who is going with obama, answer: Gen. David Petraeus | question: who is going to be at the talks, answer: Sen. Barack Obama and Iraqi Prime Minister Nuri al-Maliki