WASHINGTON — If a major-league baseball team plays a spring training game in Cuba next year, it will be the Tampa Bay Rays.

Commissioner Rob Manfred chose the Rays by picking a ball out of a bin at baseball’s offices on Park Avenue in Manhattan on Friday afternoon.

So many teams, including the Mets, the Yankees and the Los Angeles Dodgers, had wanted to play in Cuba that Manfred decided to hold a lottery.

It is not a forgone conclusion that there will be a game. Major League Baseball still needs to negotiate the terms of the game with the Cuban government. The game would most likely be against the Cuban national team and would be played in Havana.

Interactive Feature | Sports Newsletter Get the big sports news, highlights and analysis from Times journalists, with distinctive takes on games and some behind-the-scenes surprises, delivered to your inbox every week.

In October, Major League Baseball sent several officials to Cuba to examine the main stadium in Havana to determine whether it could host a major league game. The officials reported back to the commissioner’s office that the field was not in great condition and would need some work before a game could be played on it.

When the Baltimore Orioles played the Cuban national team in 1999, Sandy Alderson, the baseball official in charge of the game, had to have special equipment shipped to Cuba to get the field into shape.

Manfred has made strengthening Major League Baseball’s bonds with Cuba a top priority. His top lawyer, Dan Halem, has been working with the Obama administration and the Cuban government to come up with ways for Cuban players to join major league teams.