HAVANA — Fidel Castro called the building a “nest of spies,” routinely marshaling tens of thousands of people to protest at its doorstep. His government even made a television mini-series with what it called images of American diplomats lurking in a forest nearby, dropping off suspicious bags and marking benches in acts of espionage.

President George W. Bush took swipes of his own, installing a Times Square-style ticker on the building’s side to flash news and political statements. The move so enraged Cuban officials that they erected a thicket of 138 black flags on towering poles to block the sign.

Now the building, the American government’s main outpost in Cuba, for decades a hulking symbol of the tensions between the two countries, is supposed to become something else: a full-fledged embassy operating in the open for the first time in more than five decades.

Officially, the six-story embassy, in a choice spot along Havana’s seaside highway, was closed after President Dwight D. Eisenhower broke ties with Cuba in 1961. Yet it has hardly been dormant. Since 1977, the United States has run it as an “interests section” to process visas, hold cultural events and keep some communication flowing between the two estranged neighbors.