All around the city on Sunday, Mr. Obama’s name could be heard — before he arrived, when bartenders on a hotel rooftop thought they saw his entourage; when he landed, as groups of Cubans stood under verandas by the sea; and in homes across the city, where families watched him wave and smile on Cuban television.

“It totally satisfies my soul to be able to have lived to see this moment, a moment I never thought I would have seen,” said Carmen Diaz, 70, watching Mr. Obama’s arrival from her daughter’s living room. “I feel this visit of an American president to Cuba is being done in the most elegant way possible.”

Still, between the rain and the muscular security presence throughout Havana after the arrest of dozens of dissidents Sunday morning, the arrival brought out little of the excitement and pride that many Cubans have expressed at having an American president — and better yet, this president — in their midst.

In Old Havana, many of the old streets were empty during Mr. Obama’s tour. A few people tried to sneak a peek at the president, but were turned back more than a dozen blocks away. One shop owner, near a poster showing President Castro and President Obama together, said before Mr. Obama landed that she had been told to close her shop during his walk through the area.

“People will look in the windows,” she said. “It’s fine. I’ve been talking to all my friends about Obama, and we’re all just happy to see him coming.”