Rene Braeunlich and Thomas Nitzschke arrived at Tegel military airport early Wednesday afternoon.
Appearing tired but in good health, the pair told journalists gathered at the airport they were happy to be home.
"We had a really hard time, but we'd like to thank the people at the [German] embassy and all those who worked to free us," Braeunlich said.
"We are very glad to be alive, which was not a given," added Nitzschke.
The two men were abducted from outside their workplace in the industrial Iraqi town of Baiji, 180km north of Baghdad, on January 24.
Ansar al Sunna, the group which claimed to be holding the men, had threatened to kill them both unless their demands were met.
Foreign ministry spokesman Jens Ploetner said earlier that the men, who both hail from the eastern city of Leipzig, would be flown from Berlin to a secret location to be reunited with their families.
The foreign ministry has declined to provide details on how the pair were freed, citing security reasons.
However Iraq's ambassador to Germany told a German television channel that he thought a ransom had been paid, AFP reported.
Another German hostage, archaeologist Susanne Osthoff, was freed in December after being held hostage in Iraq for three weeks.
German media have quoted unidentified diplomats as saying Berlin paid the kidnappers $5 million for her release.
The pair were shown on a video
released by their captors
The German government is known to have paid ransoms for hostages in the past, but refused to comment on whether it did so for Osthoff.
More than 200 foreigners and thousands of Iraqis have been kidnapped since the US-led invasion of Iraq in 2003. Most foreign hostages have been released, but several have been killed or are still being held.