Zynga has acquired NaturalMotion, the software company behind the popular interactive toy app Clumsy Ninja.

According to Re/code, Zynga is paying $391 million in cash plus 39.8 million shares of stock, resulting in as much as $527 million, for NaturalMotion. Notably, this is Zynga’s largest acquisition yet, much larger than its $180 million acquisition of Draw Something developer OMGPOP in March 2012.

Zynga CEO Don Mattrick gives the following explanation for buying NaturalMotion at such a high price: “At their core, they have a breakthrough tools and tech pipeline which I believe will become more and more valuable as tablets and phones increase in their performance capability.”

Indeed, while it licenses out its advanced animation and A.I. technology for console games, NaturalMotion keeps the technology for its own games (including Clumsy Ninja, My Horse, Backbreaker Football, and CSR Racing) when it comes to mobile.

“This could potentially be a big competitive advantage for Zynga in the coming years,” Re/code notes, “as mobile games continue to grow more sophisticated and, as Mattrick points out, smartphones and tablets naturally come with more robust hardware.”

As a result of the acquisition deal, Zynga gains 260 employees from NaturalMotion. This move takes place even as Zynga plans to lay off about 300 employees in line with its refocusing toward games with more revenue potential (e.g. Clumsy Ninja).