"The state of Qatar informed the government of Djibouti that it has withdrawn all its troops deployed on the border line in Djiboutian territory," a ministry statement said.
The ministry said Qatar had been an "impartial diplomatic mediator" in the dispute between Djibouti and Eritrea, which led to armed clashes in 2010.
The decision by Qatar to withdraw its troops comes as the Gulf emirate is locked in a bitter dispute with Saudi Arabia and its allies over alleged ties to Islamist extremists, a charge it denies.
Qatar has also played the role of mediator in other African conflicts.
It brokered a peace deal between the Khartoum government and rebels in the Red Sea coast region of Sudan, which borders Eritrea. It has tried to do the same in the conflict in Sudan's western region of Darfur.
Disclaimer: No Business Standard Journalist was involved in creation of this content