Topps, the business that put Bazooka bubble gum together with baseball cards more than half a century ago, now belongs to a fast-growing sports memorabilia empire that nearly knocked Topps out of the baseball-card game.

On Tuesday, Topps announced that it had sold its sports card business to Fanatics, a multibillion-dollar, 10-year-old company whose licensing business was built on sports fandom, technology and networking. The deal values Topps’ sports and entertainment division at slightly more than $500 million, according to people with knowledge of the situation, speaking on the condition of anonymity because the information is confidential.

Topps had previously announced a deal to go public. But in August, the company was blindsided when it lost its licensing agreement with Major League Baseball and the Major League Baseball Players Association to Fanatics, putting its future in doubt. Fanatics and Topps began discussing the acquisition of Topps’ card business roughly a month after Topps lost the baseball contract, a person familiar with the situation said.