McAfee Inc , the No. 2 security software maker, reported a stronger-than-expected quarterly profit, helped by new software modules and partnerships with PC vendors.

The company, which competes with No. 1 security software maker Symantec Corp , forecast second quarter earnings at the high end of market expectations and its shares rose 3.9 percent in after-hours trading on Thursday.

Sales of security products are holding up better than other types of software because companies are afraid to let down their defenses against anyone trying to break into their computer systems. Computer crimes have been on the rise for several years, a fact that companies like McAfee and Symantec spend millions of dollars a year to publicize.

Companies consider security spending to be sacrosanct, said Laura DiDio, an analyst with technology consulting firm ITIC. Security vendors are somewhat insulated from the effects of the recession because security is so critical.

McAfee's two business units are also in the midst of growth cycles. Corporate sales grew 28 percent as customers expanded the number of security software modules they bought at once, while consumer sales rose 12 percent due to new partnerships with PC makers, which preload McAfee's programs on their machines.

They've done a good job in scaling the model, said FBR Capital Markets analyst Daniel Ives. This year, you are starting to see them reap the benefits.

McAfee posted a profit, excluding items, of 57 cents per share in the first quarter, beating the average analyst forecast of 48 cents, according to Reuters Estimates.

Non-GAAP operating income rose 38 percent from a year earlier to $114 million.

Company executives were upbeat about the outlook.

Chief Executive Dave DeWalt said that the order pipeline looks strong; that he has already signed several large deals in the current quarter; and he told investors during a conference call that 92 percent of McAfee's revenue in the first quarter came from a recurring income stream.

Chief Financial Officer Rocky Pimentel said during the call he expects very strong cash flow performance this year.

McAfee forecast current quarter profit, excluding items, of 54 cents to 58 cents per share, on revenue of $455 million to $475 million. Analysts had expected profit of 54 cents a share on revenue of $466 million, according to Reuters Estimates.

In a bid to win sales away from bigger rival Symantec, DeWalt spent more than a year bolstering relationships with the PC makers including Dell Inc , Acer Inc <2353.TW>, Lenovo Group Ltd <0992.HK> and Toshiba Corp <6502.T>.

McAfee's operating margin rose 3 percentage points from a year earlier to 25.4 percent. But the company forecast it will decline in the second quarter to between 23 and 25 percent.

In an interview, DeWalt said that he was not satisfied with that level of profitability.

There are many peers to McAfee in terms of sales that have higher margins, he said. You always aspire to have growth in terms of operating margins. We hope to get there.

He declined to provide a specific target.

First-quarter net income rose to $53.5 million, or 34 cents a share, from $30.2 million, or 18 cents a share a year earlier.

Shares of the Santa Clara, California-based company rose to $39.00 in extended trading. They had gained 0.9 percent to $37.54 on Nasdaq during the regular trading session.

(Reporting by Jim Finkle; Andre Grenon and Bernard Orr)