Yet perhaps no game developer has come to the field after a previous rise — and fall — as meteoric as Mixi’s. Unveiled in February 2004, the same month as Facebook, by a 28-year-old Internet entrepreneur named Kenji Kasahara, its social network quickly attracted a following in Japan. The company went public two years later, and by late 2007 investors valued it at more than $3 billion.

Image A screenshot from the smartphone game Monster Strike. It has been downloaded more than 20 million times, mostly in Japan. Credit... Mixi

For a while, it looked as if Mixi might become one of the few social networks to resist Facebook’s global onslaught. It was gaining users even after Facebook started a Japanese-language version, in 2008. At one point, 27 million people, or one in five Japanese, had a Mixi account.

But eventually Mixi succumbed, as users turned to Facebook and other social networks like Twitter and Line, a popular messaging app. Last year, it stopped publishing membership data after the number of people who logged on at least once a month fell to half of what it had been at the company’s peak. Experimental ventures like matchmaking and photo-sharing services failed to catch on. Last year, Mr. Kasahara stepped aside as chief executive, succeeded by a 30-year-old former McKinsey consultant who had once trained as a jockey in Australia. Mixi’s stock dropped to 5 percent of its peak value.

All of this was before Monster Strike. In the last year, the company has recouped all its stock market losses and then some as investors have poured back in. Content revenue — essentially all from Monster Strike — reached 19.4 billion yen ($161 million) last quarter, or about 90 percent of Mixi’s total income. In June, the head of the game-development division took over as president.

“It was a big bet,” the new leader, Hiroki Morita, said in an interview, of the decision to expand into gaming. Although there were precedents — two big Japanese mobile gaming platforms, Gree and DeNA, had started in unrelated Internet businesses — Mixi “had fallen behind,” he said.

To differentiate itself, Mixi decided it wanted a game that people could play face to face, Mr. Morita said, “something you could play with friends if you were out drinking, for example.”

The company solicited prototypes from outside developers. The one it chose was from Yoshiki Okamoto, who had created the popular console-era franchise Street Fighter. The Monster Strike app made its debut on Apple’s app store in October 2013, and Mixi spent about $5 million on television commercials and other promotions — an unusually aggressive marketing campaign for a smartphone game.