Twitter has acquired TweetDeck, we’ve heard from a source with knowledge of the deal, and the transaction will be announced in the next few days. The $40 million – $50 million purchase price includes both cash and Twitter stock, says our source.

In February we reported that an acquisition of TweetDeck by Bill Gross’ UberMedia was all but done, in the $25 – $30 million range. And that deal was in fact all but done. But Twitter quickly provided an unsolicited counter offer, and TweetDeck was in play again. TechCrunch EU has the full story on how that played out.

This deal is defensive for Twitter, say all the sources we’ve spoken with over the last couple of months. They simply couldn’t allow UberMedia to have so much market share in this space. The company has acquired UberTwitter, EchoFon and a number of other Twitter-related startups. Adding TweetDeck to the UberMedia stable of products would give them too much leverage over Twitter, say our sources, and so Twitter made a strong defensive bid to disrupt the deal. Which succeeded nicely, apparently.