Somali Defense minister Abdulqadir Mohamed Nur told Reuters that a first batch of troops - he did not specify how many - from Eritrea had arrived in Somalia on Wednesday.
"They will participate in the war on al Shabab," he said, referring to an al Qaeda-affiliated militant group seeking to impose its strict interpretation of Islamic law across Somalia.
The soldiers were sent to Eritrea during former president Mohamed Abdullahi Farmaajo's administration. After coming to power in May, President Hassan Sheikh Mohamud's government said that 5,000 missing soldiers had been "found" in Eritrea and would be brought home soon.
Several of their family members told Reuters last year that the men had been recruited by Somalia's federal government for jobs in Qatar, but that they then surfaced in Eritrea where they were forced to serve in the military.
Eritrea is often described by critics as "the North Korea of Africa" for its use of forced labor, repression and surveillance of its citizens.
The apparent secretive recruitment of young Somali men stirred public anger and triggered protests in the capital Mogadishu and elsewhere.
The Somali and Eritrean governments denied the men were held against their will.
Little is known about what the Somali troops did while in Eritrea. A U.N. report last year cited reports that some of them were sent to fight in a war in neighbouring Ethiopia's Tigray region.
Somali authorities denied that the soldiers fought in Ethiopia.
Abdisalam Guled, former deputy director of Somalia's National Intelligence and Security Agency who first revealed the soldiers' presence in Eritrea, told Reuters that their return was great news but called for more transparency.
"We urge the government to find out the number and health of the soldiers returning if it does not know how many were first taken to Eritrea by the previous government," he said.