The withdrawal came after a judge ruled the customers have a right to keep their reading habits from the government.
"The (subpoena's) chilling effect on expressive e-commerce would frost keyboards across America," U.S. Magistrate Judge Stephen Crocker wrote in a June ruling.
"Well-founded or not, rumors of an Orwellian federal criminal investigation into the reading habits of Amazon's customers could frighten countless potential customers into canceling planned online book purchases," the judge wrote in a ruling he unsealed last week.
Amazon said in court documents it hopes Crocker's decision will make it more difficult for prosecutors to obtain records involving book purchases.
Crocker - who unsealed documents detailing the showdown against prosecutors' wishes - said he believed prosecutors were seeking the information for a legitimate purpose. But he said First Amendment concerns about freedom of speech were justified and outweighed the subpoena's law enforcement purpose.
"The subpoena is troubling because it permits the government to peek into the reading habits of specific individuals without their knowledge or permission," Crocker wrote. "It is an unsettling and un-American scenario to envision federal agents nosing through the reading lists of law-abiding citizens while hunting for evidence against somebody else."
Federal prosecutors issued the subpoena last year as part of a grand jury investigation into a former Wisconsin official who was a prolific seller of used books on Amazon.com. They were looking for buyers who could be witnesses in the case.
The official, Robert D'Angelo, was indicted last month on fraud, money laundering and tax evasion charges. Prosecutors said he ran a used book business out of his city office and did not report the income. He has pleaded not guilty.
D'Angelo sold books through the Amazon Marketplace feature, and buyers paid Amazon, which took a commission.
The initial subpoena sought records of 24,000 transactions dating back to 1999. The company turned over many records but refused to identify the book buyers, citing their right to keep their reading choices private.
Prosecutors later narrowed the subpoena, asking the company to identify a sample of 120 customers.
Crocker brokered a compromise in which the company would send a letter to the 24,000 customers describing the investigation and asking them to voluntarily contact prosecutors if they were interested in testifying.
Prosecutors said they obtained the customer information they needed from one of D'Angelo's computers they seized earlier in the investigation.
Crocker scolded prosecutors in July for not looking for alternatives earlier.
"If the government had been more diligent in looking for workarounds instead of baring its teeth when Amazon balked, it's probable that this entire First Amendment showdown could have been avoided," he wrote.