Eritrea will withdraw troops from Ethiopia almost five months after a conflict started in the Tigray region, Ethiopia's prime minister has said.
The soldiers are there to back Ethiopia's government as it fought a group that challenged the central government's rule.
Thousands have died in the conflict, human rights groups say.
Eritrea has not confirmed the troop withdrawal from some areas across the border in Ethiopia.
The presence of Eritrean troops in Ethiopia was especially controversial because the two countries had fought a bitter border war, which was only officially ended after Abiy Ahmed became prime minister in 2018 - a move which earned him the Nobel Peace prize the following year.
The conflict began in November after the Tigray People's Liberation Front (TPLF) captured military bases in the northern Ethiopian region.
The TPLF had been the ruling party in the area but had had a massive falling-out with Prime Minister Abiy over the future of Ethiopia's ethnically based federal system and their role in government.
Following a trip to the Eritrea capital, Asmara, Mr Abiy wrote: "Eritrea has agreed to withdraw its forces out of the Ethiopian border." No date has been set.
He admitted this week for the first time that Eritrean troops were in the region, saying they feared they would be attacked by Tigray's fighters.
The soldiers are accused of committing atrocities and Ethiopia is under growing international pressure including from the United Nations to end the conflict.
But the troop withdrawal is unlikely to end the fighting as the political dispute between Mr Abiy and the TPLF remains unresolved.
A shift in tone
By Kalkidan Yibeltal, BBC News, Addis Ababa
Prime Minister Abiy Ahmed's announcement of the withdrawal of Eritrean troops comes amid growing international pressure on his government to act over numerous reports of atrocities in Tigray.
Together with his admission of the Eritreans' presence, it marks a shift in tone and approach. It could indicate the Ethiopian government feels it is in control of Tigray despite continuing reports of sporadic clashes with TPLF forces.
As the Eritrean troops have been repeatedly accused of gross human rights violations including the massacre of civilians and systematic rape, their pull-out could make it easier to conduct an independent investigation into the allegations, although both Ethiopian soldiers and TPLF fighters have also been accused as well.
Eritrea has not yet reacted to Mr Abiy's statements.
But the withdrawal is unlikely to include the disputed border areas that sparked the 1998-200 war between the two countries.
Despite those areas being awarded to Eritrea by an international tribunal, they remained under Ethiopian control - for which Asmara blamed the TPLF, which was in control of both Tigray and the whole of Ethiopia at the time.
line
What has happened in Tigray?
Hundreds of thousands of people have fled their homes in Tigray over the last five months.
Despite the TPLF being ousted from power in Tigray at the end of November and Mr Abiy declaring that the conflict was over, fighting is continuing in parts of the region.
Rights groups allege Eritrean soldiers have committed atrocities in towns like Aksum, which include killing unarmed civilians, raping women and looting public and private property.
Eritrea has dismissed accusations of abuses - in particular those detailed in Aksum - as "preposterous" and "fabricated".
Tigrayan forces also face accusations of human rights abuses.