U.S. business software maker VMware Inc posted higher-than-expected quarterly results on Wednesday due to strong sales to the federal government and gave a revenue forecast that beat Wall Street estimates.

The company, whose shares rose 2 percent after hours on Wednesday, said it was now able to better forecast the spending climate. It expected revenue of $540 million to $560 million for the December quarter, better than the average analyst target of $523 million, according to Thomson Reuters I/B/E/S.

The economic climate has improved and there are definitely some swallows in the sky, but we should remain cautious. It's too early to declare that summer has returned in full, Chief Executive Paul Maritz said on a conference call with analysts.

The company, which makes virtualization software that boosts the efficiency of computer servers, expects the next two quarters to follow seasonal patterns, with revenue in the March period down roughly 5 percent from December.

Third-quarter revenue rose 4 percent to $490 million, ahead of the average analyst forecast of $474 million.

Excluding items, profit was 24 cents a share, beating the average analyst estimate of 20 cents.

Caris & Co analyst Curtis Shauger called the report solid across the board. He said licensing sales came in a little lower than he thought, but that VMware made up for it on maintenance revenue.

Virtualization is a pretty hot topic right now, the fact that they're able to guide like that give us confidence, he added.

License revenue came in at $240 million, down 16% from last year, while software maintenance revenue rose 44 percent to $213 million.

VMware's programs boost efficiency by running dozens of virtual machines on a single piece of hardware. That helps companies save money on hardware, maintenance and electricity.

The Palo Alto, California-based company reported a net profit of $38.2 million, or 9 cents a share in the third quarter, down from $83.3 million, or 21 cents a share, in the year-ago period.

Earlier this year, VMware announced the first major upgrade to its main product line, vSphere, in three years. The product is the fourth major release of VMware's virtualization software since the company was born 11 years ago.

The company said it will take several quarters before vSphere begins to significantly impact revenue. VSphere has seen more than 500,000 downloads in its first four months of availability.

VMware's stock has surged around 45 percent over the past 3 months, compared to roughly 12 percent rise in the Nasdaq. The shares closed at $44.93 on the Nasdaq and rose to $45.60 in extended trading.

(Reporting by Gabriel Madway; editing by Andre Grenon)