Microsoft Corp., maker of the Xbox video-game console, has agreed to acquire Mojang, the software company behind the popular game Minecraft, for $2.5 billion, in a bid to boost its Xbox and mobile businesses.

Microsoft, the world's largest softwaremaker, said Stockholm-based Mojang will join its game-studio division, though the company's founders will move on to other projects. The purchase is projected to close late this year and will break even in fiscal 2015, Microsoft said Monday.

Buying Mojang would be the biggest deal struck since Satya Nadella took over as Microsoft's chief executive officer in February, succeeding Steve Ballmer. The purchase gives him a game that is popular across consoles, computers and mobile devices made by Microsoft and rivals like Apple. It also bolsters a push to woo serious gamers back to Xbox after a lackluster attempt to turn the system into an all-in-one device that serves up broader content such as movies and music.

"Minecraft is more than a great game franchise — it is an open-world platform, driven by a vibrant community we care deeply about, and rich with new opportunities for that community and for Microsoft," Nadella said in a statement.

Microsoft will continue to make Minecraft available across all software platforms, including personal computers, Apple's iOS, Google's Android and Sony's PlayStation console.

Redmond, Wash.,-based Microsoft plans to pay for the acquisition with cash held overseas, said Peter Wootton, a company spokesman. That would have favorable tax consequences for the softwaremaker, which has its vast majority of cash and short-term investments kept outside the United States.

Since taking over as CEO, Nadella has been refocusing Microsoft's efforts around software for mobile gadgets and the cloud, as the PC market continues to slow. He's advocated a strategy of making the company's programs compatible with rival operating systems and devices, instead of just those based on Microsoft's Windows.

Minecraft, a game that puts users inside a vast, pixelated virtual landscape, is made for multiple platforms including game consoles, PCs and smartphones. As of June, four-year-old Mojang had sold more than 54 million copies of the game in all its forms.

The deal came together after Mojang co-founder Markus Persson reached out to Microsoft a few months ago, based on a positive working relationship on Minecraft for Xbox, a person familiar with Microsoft said last week. The two companies quickly agreed on a framework and approximate price and had been working out the details since, the person said.

"There are only a handful of potential buyers with the resources to grow Minecraft on a scale that it deserves," Owen Hill, a spokesman for Mojang, said in a posting on its website. "We're confident that Minecraft will continue to grow in an awesome way."

Minecraft is an online world where users build structures, including replicas of actual cities and buildings, and face few rules or restrictions. One aim is to avoid being eaten by monsters that come out after dark. Enthusiasts host conventions and contests to reward the most spectacular constructions.

Began as a side project

Persson founded Mojang in 2010, after he coded Minecraft on a lark in 2009 as a side project when he came home from working at his day job making games for King.com, a Britain-based gaming site.

For a while, users could buy Minecraft only on Persson's website, where it retailed for 15 euros. By April 2011, Minecraft, which is a bit like playing with Legos inside a digital landscape, had sold more than 1.75 million copies.

Mojang's game, which attracts fans of all ages, has also spawned lines of toys, books and T-shirts as well as an array of modifications, or mods, which alter and add content to the game and are written by enthusiasts rather than by the company.

Persson handed over the main Minecraft developer duties to colleague Jens Bergensten in 2011 to focus on new projects. Monday, Persson said he will leave Mojang as soon as the deal is completed, and he addressed fans' concerns about his departure in a long post on his personal website.

"Thank you for turning Minecraft into what it has become, but there are too many of you, and I can't be responsible for something this big," Persson wrote. "In one sense, it belongs to Microsoft now. In a much bigger sense, it's belonged to all of you for a long time, and that will never change."

Persson controls about 71 percent of Mojang, according to the annual reports of the gamemaker and Persson's holding company, Notch Enterprises AB. Persson's share of proceeds of $2.5 billion would be about $1.7 billion. He's also collected more than $100 million in dividends since 2011, which would give him a total net worth of $1.8 billion, according to the Bloomberg Billionaires Index.

"It's not about the money," Persson wrote Monday. "It's about my sanity."

Minecraft was the No. 2 bestselling game by physical retail copies sold in July for the PlayStation 3 and Xbox 360, behind Sony Corp.'s the Last of Us for PlayStation consoles, according to research firm NPD Group Inc. It was the No. 3 game in June.

The game was made available for the newest generation of consoles, Xbox One and PlayStation 4, earlier this month.

"Change is scary, and this is a big change for all of us," Mojang's Hill wrote in the statement. "It's going to be good, though. Everything is going to be OK."