U.S. District Judge Phyllis Hamilton in Oakland, California, on Tuesday ordered that the case be dismissed at the companies' request, averting a trial that had been scheduled for August 19.
This came after Apple issued to Amazon a covenant not to sue over the online retailer's use of the term, eliminating the need for Amazon to pursue a counterclaim seeking permission.
Apple began selling applications for mobile devices via its App Store service in July 2008. Amazon launched Amazon Appstore for Android in March 2011. Apple began the lawsuit that month.
"We no longer see a need to pursue our case," Apple spokeswoman Kristin Huguet said. "With more than 900,000 apps and 50 billion downloads, customers know where they can purchase their favorite apps."
Martin Glick, a lawyer for Amazon, said in an interview, "This was a decision by Apple to unilaterally abandon the case, and leave Amazon free to use 'appstore.'"
"We're gratified that the court has conclusively dismissed this case," Amazon spokeswoman Mary Osako said. "We look forward to continuing our focus on delivering the best possible appstore experience to customers and developers."
In its lawsuit alleging trademark violations and false advertising, Apple accused Amazon of misusing the "app store" name in connection with the sales of apps for Android devices and the Kindle Fire, a tablet that competes with Apple's iPad.
Amazon countered that the term "app store" had become so generic that using it would not mislead customers.
It said in a court filing that even Apple Chief Executive Tim Cook had used the term generically, in discussing "the number of app stores out there," while his predecessor Steve Jobs had talked about the "four app stores on Android."
Hamilton dismissed Apple's false advertising claim in January.
Later that month, the U.S. Supreme Court unanimously barred a small company, Already LLC, from trying to void Nike Inc's trademark for a line of basketball sneakers, after Nike issued a covenant not to pursue its own infringement lawsuit.
The court said allowing Already's counterclaim could encourage litigation and discourage innovation.
Apple is based in Cupertino, California, and Amazon in Seattle.
The case is Apple Inc v. Amazon.com Inc et al, U.S. District Court, Northern District of California, No. 11-01327.
(Reporting by Jonathan Stempel in New York Additional reporting by Alistair Barr and Dan Levine in San Francisco; Editing by Maureen Bavdek and Nick Zieminski)