In a statement on its official website, Talabani's office said the treatment he underwent in Baghdad "provided the right conditions for the transfer of (Talabani) out of the country for follow-up treatment in Germany." It gave no further details on his condition.
The presidency of Iraq is largely a ceremonial role. Al-Maliki is the head of government.
Talabani is overweight and has undergone several medical procedures in recent years, including heart surgery in 2008 and knee replacement surgery this year. He has previously received treatment in Germany.
Before he fell ill, Talabani was actively involved in trying to mediate in a crisis between Baghdad and the Kurds, who have their own fighters and considerable autonomy in their enclave in northern Iraq. The two sides last month moved additional troops into disputed areas along the Kurds' self-rule region, prompting fears that fighting could break out.
Last week, Talabani brokered a deal that calls on both sides to eventually withdraw troops from the contested areas, though there was no timetable for how soon the drawdown might take place.
Associated Press writers Sinan Salaheddin, Qassim Abdul-Zahra and Sameer N. Yacoub in Baghdad, and David Rising in Berlin contributed to this report.
Follow Adam Schreck on Twitter at http://twitter.com/adamschreck
Copyright 2012 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.