Activision Blizzard Inc.’s plan to buy the Dublin-based maker of Candy Crush Saga for $5.9 billion not only gives it access to the fast-growing mobile gaming industry, it will help save taxes.

By using $3.6 billion of cash stored outside the U.S. to help finance the acquisition of King Digital Entertainment Plc, Activision will save about $1 billion in taxes it would have had to pay to repatriate the money, according to tax consultant Robert Willens. Investors, who initially sent Activision shares down as much as 6.3 percent, reversed course, driving up the price by 3.6 percent to $35.85 at Tuesday’s close in New York.

Activision, known for the Call of Duty and World of Warcraft games played on consoles and PCs, is positioning itself to capitalize on growing smartphone-based play. At $18 a share, the biggest U.S. video-game maker is paying 20 percent less than King’s initial public offering price of $22.50 in March 2014. The stock had fallen after the IPO on concerns that King may fail to diversify from its top-selling game and become a one-hit wonder.

“They looked over and saw King at a pretty reasonable valuation and saw this is a fast-track way of accelerating their own mobile strategy,” said Chris Hickey, an analyst at Atlantic Equities LLP. The tax maneuver, he said, “is a fantastic move and is in a way one of the highlights of the deal.”

Today’s gains add to a yearlong rally for Santa Monica, California-based Activision. Chief Executive Officer Bobby Kotick, who won independence from Vivendi SA in 2013, had guided the stock to a 78 percent increase this year, third-best in the Standard & Poor’s 500 Index. King soared 15 percent to $17.85.

Hearthstone, a version of World of Warcraft that starts free-to-play, was a catalyst for the company to think about the opportunities, Kotick said on a conference call Tuesday. There were also benefits from cross-promotion and reaching new demographics like women, and Activision grew to know the King team working together over the past three years.

Mobile gaming is already the industry’s biggest category with revenue forecast to reach $36 billion in 2015, according to the companies. That’s projected to grow by more than 50 percent by 2019.

“Now is the right time to enter mobile gaming,” Kotick said on the call.

The boards of both companies have approved the transaction, Santa Monica, California-based Activision said Monday in a statement.

To help finance the purchase, Activision will also get an incremental $2.3 billion term loan from Bank of America Merrill Lynch and Goldman Sachs Bank. The company announced its financial results for the third quarter a day earlier than anticipated. Activision earned 21 cents per share after adjustments on sales of $1.04 billion. Both numbers exceeded analysts’ estimates.

The deal will boost Activision’s estimated non-GAAP revenue and earnings-per-share by about 30 percent in 2016, the company said.

King will continue to be run by CEO Riccardo Zacconi as an independent unit of Activision with the deal expected to be completed by spring 2016.

‘Next Step’

King makes two of the five highest-grossing mobile games in the U.S., Candy Crush Saga and Candy Crush Soda Saga. It had a market value of $4.9 billion as of Monday, according to data compiled by Bloomberg.

While the developer scored big with Candy Crush, it has struggled to create a successor to that blockbuster. King Digital’s adjusted revenue has fallen in each of the past four quarters while gross bookings, another measure of online sales, dropped 13 percent to $529 million in the second quarter.

“It’s the next step,” said Zacconi, who co-founded King twelve years ago. “This opens up opportunities we didn’t have before.”