WASHINGTON—The U.S. and Cuba have reached an agreement to restore diplomatic relations and reopen embassies in each other’s capitals, a senior administration official said Tuesday, the biggest step yet toward ending a half century of enmity between the two countries.

President Barack Obama plans to tell the nation on Wednesday that the U.S. will reopen its embassy in Havana, the official said, culminating a central aspiration of his presidency and representing the end of one of the last vestiges of the Cold War more than a...