“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 German foreign 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 Museums and Monuments, were abducted Wednesday morning from an excavation site in Kaduna state, where they were looking into ancient Nok culture.
Nigerian police confirmed the men's release but said the abductors were still at large.
“The kidnappers released them after we mounted pressure on them,” said Kaduna state police spokesman Usman Aliya, stressing that there had been no rescue operation.
“I'm not aware any ransom was paid and there has been no arrest of any of the people involved in the abduction. But we are trailing them,” he added.
German media identified the men as professor Peter Breunig and his co-worker Johannes Behringer.
Federal police chief Ibrahim K. Idris said on Thursday that the pair had been assigned security personnel but that they did not accompany them to the dig site.
A local resident who asked not to be named told AFP that the two were seized by abductors wielding guns and machetes who did not however take the two female members of the archaeological team with them.
“Surprisingly, they did not kidnap the two female German colleagues of the men. They fired shots into the air to scare off the villagers before abducting the Germans,” the witness recounted.
Two locals who tried to prevent the men from being captured were killed, he added, a toll confirmed by police.
The kidnapping took place off the main road linking the airport north of state capital Kaduna city with the national capital Abuja, 220 kilometres (137 miles) away.
Safety on the road has come under intense scrutiny in recent weeks since the federal government announced the closure of Abuja's only airport for essential runway repairs.
Nigeria's government has promised to increase security on the route but many foreign missions and companies have advised staff to limit their travel during the closure period.
In July last year, Sierra Leone's defence attache to Nigeria was kidnapped by armed men with AK-47 assault rifles in military fatigues at a fake check-point on the Abuja-Kaduna road.
The kidnapping of the two Germans has 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 has imploded, to the extent that the Control Risks consultancy has said kidnapping for ransom is now “entrenched” countrywide.
In the first half of 2016, Nigeria was the fourth riskiest place for kidnappings in the world, the consultancy said in September last year.
In the north, a government crackdown on cattle rustling has also been blamed for a rise in abductions.