MEXICO CITY — For half a century, as Fidel Castro transformed Cuba into a Communist state and sparred with the United States, his brother Raúl worked in his shadow, the authoritarian leader’s disciplined, junior partner.

But by the time the elder Mr. Castro died on Friday night, Raúl Castro, who assumed presidential powers in 2006 before getting the official title in 2008, had transformed Cuba into a country that was unrecognizable in many ways — and yet remarkably the same.

Raúl discarded some of the precepts that Fidel had considered sacred, chipping away at the Communist scaffold his brother had built. And in a stunning embrace that caught the world off guard, he negotiated an end to the 50-year diplomatic standoff with the United States that Fidel had fiercely maintained.

It is now solidly Raúl’s Cuba, an island where millennials talk to their cousins on Skype, where restaurant owners hustle for zucchini at privately run farms and where Americans clog the streets of Old Havana.