Apple’s stock gained back much of the 12 percent loss it suffered in the previous weeks’ nose dive after the company reported Tuesday $39.2 billion in revenue and sales of 35.1 million iPhones in its fiscal second quarter.

Prior to the company’s earnings announcement, shares of Apple were trading at $560, but they rose more than 9 percent in after hours to $613.

Net income for the quarter came in at $11.6 billion, or $12.30 per share, up from $6 billion in the year-ago quarter. Apple typically sets expectations low and then overshoots them. Tuesday’s earnings were no exception. A consensus estimate from Reuters showed analysts were predicting $36.81 billion in revenue, or $10.04 per share.

Canaccord Genuity technology analyst Michael Walkley reiterated his “Buy” rating on the company and raised his price target to $775 from $740.

Walkley said in comments that iPhone sales could be slowing ahead of an impending iPhone 5 launch, but Canaccord still thinks that “very strong international iPhone sales position Apple for very strong sales of an LTE iPhone 5 in the December quarter and beyond to drive strong F2013 earnings growth.”

Sales of Apple’s products were beyond expectations across the board, including for the iPod, which has typically been considered the company’s weak spot.

While Apple’s stock slipped yesterday on worries about lower iPhone sales from AT&T and Verizon Wireless, additional carrier partners apparently made up for the shortfall. Apple sold 35.1 million iPhones during the quarter, compared with 18.6 million in the previous March quarter.

On the iPad front, Apple sold 11.8 million iPads compared with 4.7 million in the year-ago quarter, an increase of 151 percent.

Sales of Mac desktops and portables hit 4 million, up 7 percent annually. Analyst firm IDC had expected 2 percent growth in PC sales.

Apple sold 7.7 million iPods, compared with 9 million in the year-ago quarter, but total iPod sales were ahead of the company’s expectations, and the iPod Touch continued to account for over half of all iPods sold.

Even the iTunes Store generated all-time record results, with revenue of almost $1.9 billion, an increase of 35 percent annually.

Apple provided guidance of $34 billion in revenue for the next quarter, which compares with $28.6 billion in the June quarter last year.

High carrier subsidies and aggressive litigation have been on Apple’s list of challenges in recent months, and Tim Cook, Apple’s CEO, fielded questions on both issues in a Q&A during Tuesday’s earnings call.

On the subject of whether carriers would attempt to stretch the customer replacement cycle to decrease subsidies, Cook downplayed the actual subsidy amount.

“From a carrier's perspective, I think it's important to remember that the subsidy is not large relative to the sum of the monthly payments across a 24-month contract period,” Cook said, adding that the difference between an iPhone subsidy and any other smartphone is relatively insignificant.

On the topic of patent litigation, which is near and dear to Apple’s heart as it is currently engaged in a number of legal battles over patents in courts around the globe, Cook might have signaled the potential raising of a white flag.

“I've always hated litigation, and I continue to hate it,” Cook said. “We just want people to invent their own stuff. And so if we could get to some kind of arrangement where we could be assured that's the case and a fair settlement on the stuff that's occurred, I would highly prefer to settle versus battle.”

Cook’s stance is a departure from his predecessor, the late Steve Jobs, who was quoted as saying he would spend his dying breath to destroy Android because he considered it a stolen product.

Apple’s legal battles are far from over. On Tuesday, a Chinese official said that the company Proview Technology does in fact hold the trademark on the iPad name in China. Also on Tuesday, the International Trade Commission (ITC) issued an initial ruling that Apple’s iPhone and iPad infringed on a 3G patent held by Motorola. A final decision on that case is expected after a review by mid-summer.

In early morning trading on Wednesday, shares of Apple were up almost 10 percent from yesterday’s close, to $615.