The United States and Cuba formally agreed on Wednesday to restore diplomatic relations on July 20, setting up a trip to Havana by John Kerry, who would become the first U.S. secretary of state to visit the country in 70 years.

Sealed by an exchange of letters between U.S. President Barack Obama and Cuban President Raul Castro, the deal fulfills a pledge the former Cold War enemies made six months ago. It also attempts to end the recriminations that have predominated ever since Fidel Castro's rebels overthrew the U.S.-backed government of Fulgencio Batista on Jan. 1, 1959.

The letters set a date of July 20 for the re-establishment of relations, and embassies could be opened at that time or later.