The Turkmen and Uzbek presidents have signed a declaration of friendship, ending years of mistrust between the two Central Asian neighbours.
Turkmenistan once accused the Uzbeks of trying to kill its president
Uzbek leader Islam Karimov and Turkmen President Saparmyrat Niyazov said all bilateral issues had been resolved.
They drank champagne to celebrate their pact in the Uzbek Silk Road city of Bukhara, near their common border.
Relations worsened two years ago when Turkmenistan accused the Uzbeks of aiding an attempt to kill Mr Niyazov.
The meeting came after four years without presidential-level contact between the two former Soviet states.
President Niyazov, known as Turkmenbashi or Father of all Turkmen, rarely leaves Turkmenistan.
But on this occasion he travelled across the desert to Bukhara for the surprise summit.
Both men have held power in their countries since before the collapse of the Soviet Union in 1991, and neither allows independent media or widespread political dissent.
They have both faced criticism from western countries about alleged human rights abuses and slow economic reforms.
The leaders agreed to share water resources and ease travel restrictions between the two countries in the hope of boosting bilateral trade, which has increased recently but has been historically low.
There have been warnings of a water crisis in southern Uzbekistan if a crumbling Soviet-built water pumping station on the Amu Darya river in Turkmen territory collapses.
President Niyazov said after the summit that Uzbek engineers would be allowed to visit the facility to help with repairs.
In addition, Turkmenistan is planning to dig a vast reservoir to be called Lake Turkmen on its side of the river.
Outsiders fear it may put ecological pressure on an already damaged area, but President Niyazov says the project has been carefully thought through.
A dispute over the Kokdumalak oil field, most of which lies in Turkmenistan but has been exploited by Uzbekistan since Soviet times, was also reported to be on the agenda.
Neither leader gave details of any discussions, but Mr Niyazov said: "Our Uzbek friends and Turkmen citizens residing at the border may sleep quietly and shouldn't worry about tomorrow."