Castro got them from the Kremlin. Why? The Kremlin was worried that Castro's pride had been hurt when he wasn't consulted about deal terms related to Soviet missile bases in Cuba, part of Russian concessions to the United States during the other earlier Cuban missile crisis—the one everyone knows about.
Russia was eager to keep its cozy relations with its Caribbean ally, so Khrushchev, unbelievably, gave the Cuban leader a monstrous "consolation prize," reported BBC.
. Conveniently, the massive weapons delivery had passed U.S. radar undetected. Crazy, no?
Also crazy? Castro. Or so thought Anastas Mikoyan, Kremlin's number two guy, after he observed the notoriously impulsive Cuban leader in Havana with growing apprehension.
"Castro particularly objected to the constant flights over Cuba by American surveillance aircraft and, as Mikoyan learned to his horror, ordered Cuban anti-aircraft gunners to fire on them," according to BBC, saying the Russian official soon became "convinced that Moscow had sold Cuba's defence down the river."
Here's what BBC said went down next:
"Mikoyan was forced to use the dark arts of diplomacy to convince Castro that despite Moscow's best intentions, it would be in breach of an unpublished Soviet law (which didn't actually exist) to transfer the missiles permanently into Cuban hands and provide them with an independent nuclear deterrent. Finally after Mikoyan's trump card, Castro was forced to give way and—much to the relief of Khrushchev and the whole Soviet government—the tactical nuclear weapons were finally crated and returned by sea back to the Soviet Union during December 1962."