Salesforce.com Inc said it has agreed to buy privately held cloud-platform company Heroku for up to $249 million to expand its presence in cloud computing related to social and mobile applications.

Salesforce said it would pay $212 million net of cash. It also plans to issue $27 million in stock to Heroku employees and pay $10 million in cash for unvested Heroku shares as part of the deal.

Salesforce expects the deal to hurt fourth-quarter adjusted earnings by 2 cents a share and by 12-13 cents a share in fiscal 2012.

The company added it does not expect Heroku to contribute materially to revenue till fiscal 2012.

San Francisco-based Heroku is a cloud-software platform company which charges developers to host applications written in the Ruby programing language on its servers.

Ruby is a programing language used to write social and mobile applications for Internet firms like Groupon, Hulu and Twitter. More than 105,000 web apps run on Heroku's application platform, according to the company.

Salesforce, which competes with SAP AG, Microsoft, Oracle and NetSuite, specializes in cloud computing services which run software applications on its computer servers on behalf of clients.

The company's shares, which have rise 26 percent since it posted strong quarterly results last month, closed at $145.24 on Tuesday on the New York Stock Exchange.

(Reporting by Himank Sharma in Bangalore; Editing by Roshni Menon)