Kyrgyz President Sadyr Japarov and his Tajik counterpart Emomali Rakhmon agreed to order a ceasefire and troop pullback in a meeting in Uzbekistan on Friday, the Kyrgyz president's office said, after deadly clashes between the two Russian allies.
The former Soviet republics earlier accused each other of restarting fighting in a disputed area that has left at least three dead and dozens wounded.
The ceasefire was set to take effect from 16:00 local time (10:00 GMT), Kyrgyz border guards said in a statement. Tajik authorities confirmed that the agreement had been reached.
Earlier on Friday, Moscow urged a cessation of hostilities.
Kyrgyzstan has said that Tajik forces using tanks, armored personnel carriers and mortars entered at least one Kyrgyz village and shelled the airport of the Kyrgyz town of Bat ken and adjacent areas.
In turn, Tajikistan accused Kyrgyz forces of shelling an outpost and seven villages with "heavy weaponry" in the same area, which is famous for its jigsaw-puzzle political and ethnic geography and became the site of similar hostilities last year, also nearly leading to a war.
A civilian was killed and three injured, authorities in the Tajik city of Isfara said. Two Tajik border guards were killed earlier this week.
Kyrgyzstan reported 31 wounded overnight in its southern Bat ken province which borders Tajikistan's northern Sughd region and features a Tajik exclave, Vorukh, a key hotspot in recent conflicts.
Japarov and Rakhmon both attended a regional security and cooperation summit in Uzbekistan on Friday. Neither mentioned the conflict in their speeches at the event where Russian President Vladimir Putin and other leaders were present.
Clashes over the poorly demarcated border are frequent, but usually de-escalate quickly.
Soviet legacy of Kyrgyzstan and Tajikistan
Border issues in Central Asia stem to a large extent from the Soviet era when Moscow tried to divide the region between ethnic groups whose settlements were often located amidst those of other ethnicities.
Both countries host Russian military bases.
Temur Umarov, a fellow at the Carnegie Endowment for International Peace focussing on Central Asia, said the remote, agricultural villages at the center of the dispute are not economically significant, but that both sides have given it an exaggerated political significance.
Umarov said that governments in both Tajikistan and Kyrgyzstan have come to rely on what he called "populist, nationalist rhetoric" that made an exchange of territory aimed at ending the conflict impossible.
Another Central Asia analyst, Alexander Knyazev, said the sides showed no will to resolve the conflict peacefully and the mutual territorial claims provoked aggressive attitudes on all levels.
He said only third-party peacekeepers could prevent further conflicts by establishing a demilitarised zone in the area.