"The two archaeologists from the Goethe University in Frankfurt are free. They are in the care of the German embassy in Abuja," a source at the ministry told AFP.
"They are doing well under the circumstances," the source added, without providing further details.
The pair, who were working with Nigeria's National Commission for Museum and Monuments, were abducted on Wednesday as they were working at an excavation site in Kaduna state, looking into ancient Nok culture.
A local resident who asked not to be named told AFP that the pair were seized by abductors wielding gun and machetes, but they did not take the men's two female German colleagues with them.
More From This Section
Two locals were killed during the abduction, he added, a toll confirmed by police.
The kidnapping took place off the main road linking Kaduna airport, to the north of the state capital, Kaduna city, with the national capital, Abuja, 220 kilometres away.
The kidnapping of the two Germans added to security concerns in a region that has seen an uptick in violence.
Kidnapping for ransom was previously almost exclusively seen in Nigeria's oil-rich south, where criminal gangs singled out the wealthy and expatriate workers in targeted or opportunistic attacks.
But it has gradually spread northwards as Nigeria's oil-dependent economy imploded, to the extent that the Control Risks consultancy has said it is now "entrenched" countrywide.
In the north, a government crackdown on cattle rustling has also been blamed for a rise in abductions.