"Both men ... will be brought to Khartoum in the course of the day. They are well, considering the difficult circumstances," the foreign ministry said in a statement.
The men work for Technische Hilfswerk (THW), the disaster relief arm of the German interior ministry. The foreign ministry gave no details on the circumstances surrounding their release.
"I thank the crisis centre and all authorities involved for their untiring and successful involvement. I also thank the Sudanese authorities for their support and cooperation," Foreign Minister Guido Westerwelle said.
The two were kidnapped in Nyala by seven men, four of them armed with assault rifles, the UN said last month. It was the first abduction of Germans in Darfur.
Darfur has seen a wave of kidnappings targeting foreign aid workers since an international court in March 2009 issued an arrest warrant for President Omar al-Bashir on charges of war crimes in Darfur.
Security has also been on the decline in Nyala, capital of South Darfur state.