Goldman Sachs raised its price target on Apple stock all the way to $240 per share from $200 per share on Thursday, admitting they got the stock completely wrong this summer as it rallied to a $1 trillion valuation.

Goldman laid out its expectations for the next generation of iPhones and reversed its previous bearish position on the technology giant.

"We also take this opportunity to eat our hat somewhat on our cautious stance this Summer," Goldman analyst Rod Hall said in a note. "We had expected worse iPhone X demand and some pullback in the stock — clearly neither of these two things happened."

Shares of Apple rose 0.7 percent in trading to $224.65 a share in trading Friday, about 7 percent away from the new Goldman target. The stock closed down 0.8 percent at $221.30 per share after Apple announced President Donald Trump's tariffs on Chinese goods will hurt the company.

Goldman estimates Apple will price the iPhone 9 at $849, rather than the $699 some have speculated. The firm sees "some flexibility down to $800" for the iPhone 9 offering but doubts Apple will "go for lower price points" after iPhone X demand was more than expected the last few months.

"Apple is once again proving itself tough to bet against," Hall added.