UNITED NATIONS - Venezuela and Guyana have agreed to return their respective ambassadors to their posts, normalizing ties after months of a bitter territorial dispute.

Venezuelan President Nicolas Maduro acknowledged that his meeting with his Guyanese counterpart David Granger at the United Nations was "tense and difficult," a statement from his Foreign Ministry read.

Maduro said a technical committee would tackle the territorial dispute between the two countries.

Venezuela has been pressing claims to Guyana's Essequibo region, which encompasses two thirds of the former British colony, since Exxon Mobil discovered oil in disputed waters off its coast earlier this year.

UN Secretary-General Ban Ki-moon, who attended the meeting, said the two presidents "expressed willingness to continue to engage in dialogue," and would receive their respective ambassadors in both capitals "in the nearest future."

Ban "praised the willingness of Presidents Granger and Maduro to uphold their countries' tradition of dialogue while a path toward resolution of the controversy is crafted that will be beneficial to both countries and their peoples," his office added in a statement.

During a visit to the US in July, Granger accused Maduro of having imperialist motives.

The Venezuelan leader hit back by saying that Granger's trip to Washington was paid by Exxon Mobil, which was financing an "international lobby" against Venezuela.

This week, Granger expressed concern about a Venezuelan troop buildup near the border. The Venezuelan government announced military exercises in the east of the country, near Guyana.