A group of Ethiopians who had been kidnapped in Libya arrived at Cairo airport on Thursday after Egyptian army forces rescued them, state media quoted Egyptian President Abdel Fattah al-Sisi as saying.
But one Ethiopian in the group, and a Libyan source, appeared to cast doubt on that version of events, saying the men had only been held up by Libyan immigration.
State TV broadcast live footage of Sisi greeting about 30 Ethiopians who had arrived on an Egyptian government plane.
"Sisi announced during a seminar the success of the armed forces in returning the Ethiopian brothers who had been kidnapped in Libya," state news agency MENA reported.
The state broadcast gave no details of their identity, the manner of their release or circumstances of detention.
Security sources told Reuters that Egyptian intelligence services had provided Libyan authorities with information that helped them free the Ethiopians who had been held by armed groups in the cities of Derna and Misrata.
One of the Ethiopians said they had been held by Libyan immigration authorities.
"The Libyan government came and took us to the anti-illegal immigration body and then the Egyptian government took us from there," he told reporters at the airport. That account was confirmed by a Libyan official.
A statement from the Egyptian presidency's office said Sisi had greeted 27 Ethiopian citizens who represented "the first batch of returning Ethiopian brothers from Libya".
Sisi has repeatedly called for international efforts to combat Islamist militants in Libya, which has descended into chaos since veteran autocrat Muammar Gaddafi was toppled in 2011 during the "Arab Spring" uprisings.
The former army chief has portrayed himself as a champion of moderate Islam in a battle against what he calls the global existential threat from groups such as Islamic State, which seized large parts of Syria and neighbouring Iraq.
Last month, a video purportedly made by Islamic State appeared to show militants shooting and beheading about 30 Ethiopians in Libya.
Militants professing loyalty to Islamic State have claimed several high-profile attacks on foreigners in Libya this year, including the beheading of 21 Egyptian Christians in February.
The killing of the Egyptians prompted Sisi to order air strikes on Islamic State targets in OPEC oil-producer Libya.
Libya's mayhem has complicated Sisi's efforts to combat hardline Islamist groups at home, including pro-Islamic State militants based in the Sinai.
"What happens in Libya is a concern for all of us, and we are saying to the world that Libya should return a safe and stable country for its people and even to its visitors," Sisi told reporters at the airport.