NAIROBI, KENYA, DEC. 28 -- The presidents of Kenya and Uganda, whose security forces faced off earlier this month in three days of bloody fighting, met today and agreed to end a cross-border dispute that has crippled Uganda's economy while pushing the two countries toward war.

The two-hour meeting in a tent erected near the Kenyan border town of Malaba signaled a dramatic improvement in what had been dangerously deteriorating relations between two east African neighbors, whose economies are closely linked.

"All the problems have been ended and trucks and people are now free to cross the border," said Ugandan President Yoweri Museveni. Kenyan President Daniel arap Moi, addressing Uganda's most pressing problem, ordered that his minister of energy facilitate the immediate shipment of gasoline to Uganda.

The border dispute had closed Uganda's main transport link to the sea and dried up its fuel supply and locked inside Kenya about 10,000 tons of Uganda-bound freight.

The meeting appeared to mark a reconciliation between two strong-willed African leaders, whose personal styles have grated on each other in the last two years.

At 62, Moi is nearly 20 years older than Museveni. The Kenyan leader is staunchly anticommunist and pro-United States. He portrays himself as a senior statesman in Africa. According to diplomats here, Moi feels that he should be accorded respect by junior leaders in the region.

Since Museveni came to power in a coup two years ago, he has seemed unwilling to pay such obeisance. To Moi's obvious irritation, the Ugandan leader has cultivated trade links with Libya and North Korea. In recent months, each leader has accused the other of supporting dissidents intent on undermining his government.

Museveni had said Moi's government was giving sanctuary to Ugandan rebels who had established guerrilla bases just inside Kenya. For his part, Moi charged that 200 Kenyan children were sent to Libya through Uganda for training to destabilize Kenya.

Ten days ago, following a shoot-out at the border between Kenyan police and the Ugandan Army, Kenya expelled the Ugandan ambassador and recalled its own ambassador from Kampala. Moi suggested then that Uganda was "preparing for war."

The outcome of today's meeting, however, suggests that Moi and Museveni have chosen economic expediency over personal acrimony. While Kenya is Uganda's main link to the sea, Uganda is the largest consumer of Kenya's exports.

"Museveni rang me about things at the border and I said come and meet me at Malaba," Moi told Reuter news agency before the noon meeting.

According to the Kenyan government radio, the two leaders agreed that Uganda would move antiaircraft guns and other artillery away from the border. The leaders also ordered police and border administrators from each country to meet regularly and discuss security and transport problems.

Ugandan radio said that Museveni had called today on all Ugandans living on the border to refrain from infringing on Kenyan sovereignty. During the meeting, Moi said that eight Kenyan truck drivers have been killed while driving in Uganda in recent weeks.