Diamonds may be a girl's best friend, but Diamond Foods (DMND.DL) was an investor's best friend today after the company reported upbeat earnings for its second quarter of fiscal 2014. Investors pushed shares of Diamond Foods higher in after hours trading on Tuesday after the company topped Wall Street's expectations for its second quarter.

Source: Diamond Foods.

The snacks company beat analysts' profit estimates by a penny, as it reported diluted earnings per share of $0.09 in the quarter, ahead of expectations for $0.08 per share. Diamond Foods reported second-quarter revenue of $220.6 million in the period, which were flat on a year-over-year basis but beat analysts' forecasts for revenue of $216.75 million in the quarter.

Snack sales rose 10.8% to $116.80 million in Q2. However, that gain was partially offset by a 10.1% decrease in nut sales to $103.8 million in the quarter. The company's nut segment was hurt by higher commodity costs for tree nuts. "While we expect to face further headwinds in the Nuts segment in the second half of fiscal 2014, our team remains focused on the execution of our multi-year turnaround strategy, and we are confident that we are taking the right steps to position our business for long-term sustainable growth," said Brian Driscoll, Diamond Foods' chief executive.

Diamond Foods' stock was up more than 5% on the news in after hours trading on Tuesday, with shares priced around $31.48 as of 5 p.m. ET. The stock has gained nearly 18% year to date.