Web-based software maker Salesforce.com Inc forecast current-quarter earnings broadly in line with Wall Street estimates and posted a quarterly net loss as its marketing and sales costs increased sharply.

The tepid outlook from one of the leaders in Internet-based cloud computing suggests it will not avoid the effects of broad cutbacks in corporate spending which have ravaged other technology firms.

Salesforce shares fell 6 percent after hours.

Chief Executive Marc Benioff said he was optimistic about companies' spending on technology and marketing, despite economic difficulties in Europe and Japan.

I don't feel like we are going into a recession, he said on a conference call with analysts.

The San Francisco-based company reported a net loss of $3.8 million, or 3 cents per share, for the fiscal third quarter, compared with a profit of $21.1 million, or 15 cents per share, in the year-ago quarter.

The loss was due to a 49 percent jump in operating costs to $465.8 million, which outpaced sales growth. The cost of stock-based compensation more than doubled to $57 million from $26 million a year ago.

Excluding certain items, such as the stock-based compensation, its profit was 34 cents per share, beating the 31 cent average estimate by analysts polled by Thomson Reuters

I/B/E/S.

Sales rose 36 percent to $584 million, surpassing the $571.5 million expected by analysts.

For the current quarter, the company forecast profit, excluding items, of 39 cents to 40 cents per share, compared to Wall Street's estimate of 40 cents.

For fiscal 2013, it made its first sales forecast, of $2.88 billion to $2.92 billion, which includes projected revenue from Model Metrics, an acquisition expected to close this quarter. Excluding that deal, analysts are expecting sales of $2.79 billion.

Salesforce.com shares dropped 7 percent in after-hours trading to $117.78, after closing at $126.09 on the New York Stock Exchange.

(Reporting by Bill Rigby; Editing by Bernard Orr and Richard Chang)