Apple reported earnings that exceeded analyst forecasts Tuesday. The company had quarterly earnings of $1.42 a share, 4 cent more than the $1.38 a share analysts expected. Shares rose 7.1 percent to $103.65 in after hours trading following the earnings report.

Its fiscal third quarter revenue of $42.4 billion also topped analyst forecasts of $42.09 billion.

Both fell from the $1.l85 a share and $49.61 billion Apple had in the same period a year ago.

CEO Tim Cook said in a press release “We are pleased to report third-quarter results that reflect stronger customer demand and business performance than we anticipated at the start of the quarter,”

He added that the company has a lineup of products in its pipeline and “I’m incredibly bullish about our long-term opportunity,” in a conference call with analysts.

Wall Street had feared that falling iPhone sales, which add up to two-thirds of Apple revenue, would adversely affect third quarter results. In April, Apple reported the first decline in iPhone sales ever. While sales did decline in the quarter, slipping from the 475 million sold last year to 40.4 million during the quarter. But that was better than analst forecast of 39.7 million.

The company’s projections were also better than expected.