Amazon and book publisher Hachette Book Group have finally reached a deal in the negotiations that have been going on since May. For months, Amazon removed pre-orders on Hachette titles, shipped them with delays and would not discount them.

The new agreement, announced in a joint press release Thursday, covers both print and ebooks.

“This is great news for writers,” Hachette CEO Michael Pietsch 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.”

“We are 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,” David Naggar, VP of Kindle, said in a statement.

When the new ebook terms take place in early 2015, “Hachette will have responsibility for setting consumer prices of its ebooks, and will also benefit from better terms when it delivers lower prices for readers. Amazon and Hachette will immediately resume normal trading, and Hachette books will be prominently featured in promotions.”

See that “responsibility for setting consumer prices”? Yep, that’s the return of agency ebook pricing about two and a half years after the Department of Justice first sued Apple and publishers for conspiring to set ebook prices. Obviously, neither Amazon nor Hachette is offering very specific details about the contract they agreed on, but the public disclosures about the deal make it sound similar to the one recently reached between Amazon and Simon & Schuster.

During the negotiations, Hachette titles were unavailable for pre-order, shipped with delays and sold without discounts. But Publishers Lunch noted Thursday morning that some change appeared to be afoot, as pre-orders were turned back on for some titles and a few titles began being discounted again. For example, Amazon chose Michael Koryta’s Those Who Wish Me Dead (great book, recommend) as one of its best 100 books of 2014 earlier this week, but was selling the hardcover at its full list price of $26. As of Thursday, however, the hardcover was being sold for $16.90 and the Kindle edition for $9.09.

A new contract is certainly be something to celebrate after months of back-and-forth PR campaigns, author manifestos and endless, endless pontificating.

This post was updated several times on Thursday.