(Reuters) - Cyber security firm Palo Alto Networks Inc forecast current-quarter revenue and profit below analysts' estimates, sending its shares down 3 percent in extended trading on Tuesday.

However, the company reported a higher-than-expected revenue for the fourth quarter as spending by companies and governments on cyber security stayed strong after a spate of major attacks in the past few years.

Palo Alto also said it would buy back up to $500 million in shares.

The company forecast revenue of $396 million-$402 million and adjusted profit of 51-53 cents per share for the first quarter.

Analysts on average were expecting earnings of 56 cents per share and revenue of $402.2 million, according to Thomson Reuters I/B/E/S.

Palo Alto's services revenue, which includes revenue from contract-based subscriptions, surged by nearly two-thirds in the fourth quarter. The company gets more than half of its total revenue from its services business.

Billings, defined as total revenue plus the change in deferred revenue, jumped 45.4 percent to $572.4 million.

Revenue surged 41 percent to $400.8 million, beating the average analyst estimate of $389.7 million.

However, its net loss widened to $54.5 million, or 61 cents per share, in the quarter ended July 31 from $46 million, or 55 cents per share, a year earlier.

Excluding items, Palo Alto earned 50 cents per share, beating the average estimate of 49 cents.

(Reporting by Aishwarya Venugopal and Supantha Mukherjee in Bengaluru; Editing by Kirti Pandey)