Cybersecurity company Palo Alto Networks' quarterly revenue and profit topped Wall Street estimates and the company gave an upbeat third-quarter forecast, helped by better-than-expected growth in its product business.

The company's shares rose 5.1 percent to $178 after the bell on Monday.

Revenue in the company's product business, which includes firewall protection software Panorama, rose nearly 20 percent to $202.2 million in the second quarter, beating the average analyst estimate of $175 million, according to Thomson Reuters I/B/E/S.

Cybersecurity firms such as Palo Alto have been benefiting from the series of cyberattacks last year including Equifax and WannaCry.

"I think it's the combination of the efficiency and newly introduced tools is what helping them drive results," Catharine Trebnick, an analyst at Dougherty & Co., said.

The company, which added close to 3,000 customers in the quarter, said the new clients included one of Europe's largest manufacturing companies that was using Cisco Systems' security offerings.

"Palo Alto has found a way to grow sales and margins despite the intense competition in the industry, especially from larger companies like Cisco," Keith Snyder, an analyst at CFRA Research, told Reuters.

Total revenue rose to $542.4 million from $422.6 million beating analysts' estimate of about $525 million.

The company's services revenue, which includes revenue from contract-based subscriptions for its security offerings and accounts for more than half of its total revenue, surged 34 percent to $340.2 million in the quarter.

However, that number missed the average analyst estimate of $355.9 million.

Palo Alto Networks forecast current-quarter revenue of $538 million to $548 million, and profit of 94 cents to 96 cents per share. Analysts' on average were expecting revenue of $532.7 million and profit 81 cents per share.

Net loss narrowed to $34.9 million, or 38 cents per share, in the quarter ended Jan. 31, from $60.6 million, or 67 cents per share, a year earlier.

Palo Alto Networks booked a one-time tax benefit of $6.2 million due to changes in the U.S. tax law.

Excluding items, the company earned 86 cents per share, beating the average analyst estimate of 79 cents.