When Kevin Kiermaier slid into home for the Tampa Bay Rays' first run of the day, U.S. President Barack Obama flung his arms wide in the sign for "safe."

Then he turned to his left and shook the hand of his seatmate and Cuban counterpart, Raul Castro.

The scene was a remarkable milestone for sports diplomacy as the two presidents try to set aside more than 50 years of Cold War hostility, during which about the only thing the countries agreed on was a shared love of baseball.

Obama and Castro even joined in when fans were doing "the wave."

In the landmark game, the first visit by a major league team to the communist island nation since 1999, the Tampa Bay Rays beat the Cuban national team 4-1 on Tuesday.

James Loney homered and drove in three runs, and Matt Moore and the Tampa Bay pitchers shut out the Cubans until Rudy Reyes homered in the ninth inning.

But the day will be remembered less for the final score than for the two men sitting in the front row at Havana's Estadio Latinoamericano, the last stop on Obama's trip to Cuba this week in a bid to further pave the road toward normalized relations.

The near-capacity crowd roared as Obama and Castro entered and walked toward their seats right behind home plate, waving to fans and greeting other dignitaries.

'Raul! Raul'

Chants of "Raul! Raul!" broke out.

Rarely has so much pomp and circumstance accompanied an exhibition game. Former all-stars Derek Jeter and Dave Winfield and Major League Baseball commissioner Rob Manfred were among the president's greeters. Secretary of State John Kerry was also in the VIP box, as well as several of Cuba's highest officials.

Before the first pitch, Rays players walked over from the dugout to say hello and passed flowers and small Cuban flags through the netting to presidential spouse Michelle Obama and the Obamas' daughter Sasha.

"Appreciate you guys," said the president, clad in a white shirt and sunglasses. Castro was slightly more formal in a blazer.

Obama shared an extended handshake with ace pitcher Chris Archer, who once was a minor leaguer for the Chicago Cubs. He gave Obama, a White Sox fan, a glove owned by Moore.

The last time a big league club played in Cuba was 17 years ago when the Baltimore Orioles came to this same stadium during spring training.

"We won't experience anything like this again," Rays manager Kevin Cash said afterward. "So it's a very special day for Major League Baseball, the Tampa Bay Rays and obviously all of our players, myself included."

Both Obama and Castro were gone by the third inning — with Obama heading to the airport to fly south for a state visit to Argentina — but the stands remained packed until the final out.

Reyes, a hometown favourite who plays for Havana's powerhouse club Industriales, finally gave the fans a reason to cheer with his solo shot.

"It kind of went quiet for a little bit, but then they get something going, you can imagine how loud this place can get when it's championship baseball," Cash said.

What the game lacked in offensive productivity from the home team, it made up for in pageantry.

Loud music and dancers on the field warmed the crowd up beforehand, and tots in tiny baseball uniforms escorted the players out for introductions.

A white-clad choir sang both countries' national anthems and a flock of doves was unleashed from the centre-field stands. The Cuban and U.S. flags fluttered atop the scoreboard under overcast skies.

Stadium got a facelift

The stadium known as "El Latino" got a facelift just before the Rays' visit, providing a freshly scrubbed backdrop.

"It's beautiful. The field looks marvellous," said Guillermo Gonzalez, an 18-year-old university student. "We are celebrating a union between two peoples, between the United States and Cuba. It's marvellous."

The stands were notably more mellow than your average Cuban game, where the music, dancing and horn-blowing can be practically nonstop.

Admission was free, and tickets were distributed to Cubans through organizations such as student groups and workplaces. That essentially assured a well-behaved crowd and no government opponents around to protest.

Maria Ester Mendoza Alvarez, a 52-year-old university professor, agreed that cultural exchanges like this one can help heal geopolitical schisms, but also said the United States ought to end its economic embargo on and give back the naval base at Guantanamo — two long-standing grievances of the Cuban government.

"Forget all the politics — we are going to enjoy this as a game, nothing more," Mendoza said.

For Dayron Varona, a homecoming

The trip was also a homecoming for Tampa right fielder Dayron Varona, who was born in Havana and spent seven years playing in Cuba before hopping a boat to Haiti in 2013. On Monday he had a tearful reunion with relatives he hadn't seen in three years.

In a symbolic moment, Varona was first to bat Tuesday. He flied out to first, to polite applause. He said after the game that "playing baseball here is a really beautiful thing, very impressive," and meeting the president was, too.

"That gave me a lot of satisfaction," Varona said. "I hope someone took a photo and has it somewhere so I can go pick it up."

Luis Tiant, a three-time MLB all-star, and Pedro Luis Lazo, who had a long career with Cuban club Pinar del Rio and the national team, threw out the first pitches.

The stadium observed a minute of silence before the game in memory of the Brussels attacks.