Sarah Tew/CNET

Amazon and publisher Hachette agreed to end their battle, bringing a close to a sour dispute lasting months over whether the Web giant can offer steep discounts on e-books.

Neither Amazon nor Hachette, a subsidiary of French corporation Lagardère Publishing, disclosed the terms of their deal reached Thursday. But the companies confirmed in a joint statement that Hachette now has the right to set the price of its e-books. The deal takes effect next year, when the two companies are set to resume normal relations. Amazon, the top online retailer in the US, will now feature the publisher's books in its promotions -- a marked departure from its behavior over the past few months.

Amazon has been fighting with book publishers over whether it can set the price for e-books and offer them at a discount to publishers' recommended pricing. It removed preorder buttons from upcoming Hachette titles in May and refused to restock its books. Amazon, which warned its licensing deal with Hachette would expire if the two companies couldn't reach agreement, stopped stocking its titles, leading to longer shipping times for US customers. Hachette publishes the works of popular authors including Douglas Preston and James Patterson.

The dispute is the latest, most dramatic chapter in a battle between established media companies and the ever growing power of Internet retailers. The popularity of companies like Amazon has undercut physical retailers, who have been struggling to remain relevant. Amazon has argued with various book publishers over whether it can set e-book pricing, and how low it could price the digital works. The debate became so heated, and publishers became so desperate to retain control over pricing, that several of them were willing to violate antitrust laws in dealings with Apple's iBooks store starting in 2010. Amazon's victory in the antitrust case sparked a turning point for e-book pricing that end up solidifying its business model.

Much of the dispute between Amazon and Hachette took place behind closed doors, though both companies had made public statements. An Amazon post in July hinted that the etailer wanted to set a $9.99 price ceiling on e-books. Hachette, the fourth-biggest publisher, wanted a range of prices between $12.99 and $14.99.

Amazon also was reportedly pursuing a larger cut from each sale -- as much as 50 percent for each e-book sold compared with the 30 percent it's historically taken.

"This is great news for writers," Michael Pietsch, Hachette's chief executive, said in a statement. "The new agreement will benefit Hachette authors for years to come. It gives Hachette enormous marketing capability with one of our most important bookselling partners."

The resolution marks a rare victory for the publishing industry, which has struggled as more people buy relatively inexpensive e-books distributed over the Internet. Amazon controls, by some estimates, a third of the entire book market and more than half of the e-book market, thanks to its Kindle electronic reader platform. That share has given Amazon enormous clout in negotiations with publishers.

Hachette appears to have brokered a compromise with the e-commerce giant. Amazon is "pleased with this new agreement as it includes specific financial incentives for Hachette to deliver lower prices, which we believe will be a great win for readers and authors alike," Dave Naggar, Amazon's vice president of Kindle, said in the statement.

Amazon and Hachette declined further comment.

Authors began a campaign to resolve the dispute in their favor. Preston, a New England-based writer of thrillers, took out a full-page ad in The New York Times in August condemning Amazon's actions. Authors United, a group of more than 1,100 writers including John Grisham, Malcolm Gladwell and Philip Roth -- sent a letter complaining about Amazon's practices to Amazon's board. The group also asked the Justice Department to investigate Amazon for monopolistic behavior.

"I'm relieved that Amazon and Hachette reached an agreement," Preston told The New York Times today. But "if anyone thinks this is over, they are deluding themselves. Amazon covets market share the way Napoleon coveted territory."

The back and forth with Hachette may have damaged Amazon's public image, said BCG analyst Colin Gillis. "People associate with authors," he said. "It's good that it was resolved, but we'll see if hardcore readers see Amazon in a different light."

Some authors remain wary. "Don't assume that because both Amazon and Hachette are 'happy,' that this means everything will be peachy for Hachette authors," John Scalzi, a science fiction writer who isn't published by Hachette, wrote on Twitter.

Neither company commented on whether shipment delays on Hachette titles will continue until 2015. A hardcover copy of Preston's " The Long Island," a Hachette published book that qualifies for Amazon's fast-shipping Prime service, still takes one to four weeks to arrive.