WASHINGTON — The United States and Cuba quietly but officially opened embassies on each others’ territory at the stroke of midnight Monday, restoring full diplomatic relations and ending half a century of diplomatic separation between the longtime adversaries.

The State Department formally upgraded its limited diplomatic mission on the historic Malecon waterfront in Havana into a full-fledged embassy, and Cuba did the same with a stately mansion it owns in the Adams Morgan neighborhood, a center of Washington’s Latino immigrant community.

Secretary of State John F. Kerry plans to visit Cuba on Aug. 14 to raise the U.S. flag over the embassy for the first time since the Eisenhower administration severed ties with Cuba in 1961.

Shortly after 4:30 a.m., still long before sunrise, a Cuban flag was added to the standards of more than 190 other nations in the State Department’s cavernous marble lobby. A State Department video posted later shows an unidentified worker on a squeaky hydraulic lift placing the red, white and blue banner into a flag-holder next to the Croatian flag.

Bruno Rodriguez, Cuba’s foreign minister, later hoisted a Cuban flag up a gleaming white pole in front of the ornate three-story embassy and before about 500 invited guests, including several members of Congress. Moments later, a recording of the Cuban national anthem blared through loudspeakers.

Assistant Secretary of State Robert Jacobson, who led the talks to restore ties, was the highest ranking U.S. official to attend. The White House sent Benjamin J. Rhodes, a deputy national security adviser who took part in the secret diplomacy that led to the opening.

Onlookers and protesters lined both sides of the busy street, chanting pro- and anti-Castro slogans. The protests were peaceful on a sweltering, steamy morning.

Speaking to the crowd, Rodriguez mixed Cuban revolutionary doctrine with thanks to President Barack Obama and Cuban President Raul Castro for restoring diplomatic ties after decades of official hostility. He said reopening embassies will “pave the way to the complex and certainly long process toward the normalization of bilateral relations.”

But Rodriguez said only the lifting of the decades-old U.S. trade embargo, return of the U.S. Navy base on Guantanamo Bay and “respect for Cuba’s sovereignty will lend some meaning to the historic event that we are witnessing today.”

U.S. officials who attended obviously supported the opening. Harsh critics in Congress stayed away.

“It’s a great first step … but it took 55 years getting here,” said Rep. Dan Beyer, D-Virginia, after the ceremony. “It won’t be solved in 55 days.”

“It’s never just symbolic when two countries establish diplomatic relations,” said Jose E. Serrano, D-New York. “It was a very emotional moment with lots of tears when Bruno said ‘Welcome.’”

In a statement, Sen. Robert Menendez, D-New Jersey, a Cuban-American who opposes the opening, said diplomatic relations with Washington “are a privilege and must be earned, yet the Cuban government refuses to make any substantial changes to uphold democratic principles and human rights.”

Appearing later at the State Department with Rodriguez, Kerry hailed the thaw in long frozen relations “as a time to start repairing what has been broken, and opening what for too long has been closed.”

Kerry acknowledged that the effort to normalize relations would be “long and complex. Along the way, there are sure to be bumps in the road and moments of frustration. Patience will be required.”

In Havana, the scene was more low-key. Though no flag was raised at the newly converted U.S. Embassy building, some American tourists in ad-hoc celebrations waved tiny U.S. flags and took selfies under the blazing morning sun.

The embassy’s Facebook page showed employees in the building watching the Washington ceremonies on television.

One issue that continues to rankle the Cubans is the desire of U.S. diplomats to have freedom to visit dissidents, whom the Castro government regards as U.S.-paid mercenaries with next-to-no relevance on the island.

“We are hoping with the new diplomatic level, the Americans will be able to have more contact with people who are more representative of Cuban society,” said a Cuban official, who was not authorized to speak publicly.

The six-story building that houses the embassy has a storied past as a critical listening post for the Americans — a hotbed of espionage as far as the Cubans were concerned.

The Obama administration, which views the diplomatic thaw as a major foreign policy success, is eager to publicize the end of Cuba’s formal isolation to maintain momentum for more moves toward normalization.

“This is yet another demonstration that we don’t have to be imprisoned by the past,” the White House said in a statement.

“We look forward to collaborating with the Cuban government on issues of common interest, including counter terrorism and disaster response,” the statement reads. “And we are confident that the best way to advance universal values like freedom of speech and assembly is through more engagement with the Cuban people.

But with many in Congress determined to hang on to the economic embargo first imposed in the 1960s, and repeatedly tightened, the next big steps toward normalization are unclear.

Distributed by Tribune Content Agency, LLC.