Castro launched a scathing attack on Mexico on 1 May
|
Cuba and Mexico are to return their respective ambassadors to try to mend relations strained earlier this month.
Mexico, once Cuba's strongest ally in Latin America, accused Havana of interfering in its affairs and pulled out its envoy on 2 May.
Cuba responded by doing the same with its ambassador in Mexico City.
Cuban Foreign Minister Felipe Perez Roque and his Mexican counterpart, Luis Ernesto Derbez, said they had agreed to normalise ties.
The agreement came during talks on the sidelines of a European-Latin American summit being held in the Mexican city of Guadalajara.
"The objective is to normalize our relations as they were
before 2 May," Mr Ernesto Derbez said.
"I believe there will be a solution but I don't know when. I think it will take some time."
"The atmosphere and discussion [at the meeting] point to a solution to the diplomatic crisis we have lived through," said Mr Perez Roque.
Mr Perez Roque did not give a date for the ambassadors' return.
Series of spats
The row marked a new low point in ties between Mexico and Cuba, which have been tense since President Vicente Fox came to office in Mexico in 2000.
On 1 May, Cuban President Fidel Castro launched a scathing attack on countries, including Mexico, which had backed a United Nations censure of Cuba's human rights record.
The Mexican authorities were also angered by what they saw as interference in Mexico's internal affairs.
They said Cuban Communist Party Members were holding unauthorised meetings in Mexico and accused Mr Fox's government of trying to discredit the left-leaning Mayor of Mexico City, Andres Manuel Lopez Obrador.
On Wednesday, Cuban President Fidel Castro said he was not attending the Guadalajara summit.
This was in part because he was angry with Mexico but also in disgust at what he called he called European "complicity" and Latin America's "submission" to US policies against Cuba.