In a titanic battle worthy of Harry Potter and Lord Voldemort, one of Britain's largest supermarket chains and the country's most powerful independent publisher squared up yesterday over the latest novel about the young wizard.

Less than a week before the launch of Harry Potter and the Deathly Hallows, the seventh and final book in JK Rowling's series, Asda launched an extraordinary attack on Bloomsbury, the publisher of the book, accusing it of "blatant profiteering" and "attempting to hold children to ransom" over the recommended retail price of the novel.

Bloomsbury, in response, threatened to cancel the supermarket chain's order of 500,000 copies of the novel, which will be published at midnight on Friday, claiming Asda was in arrears over monies it owed the publisher. It also instructed its lawyers over the statement, which the firm's marketing director, Minna Fry, described as "extremely provocative and...potentially libellous".

Last night it was clear that the boy wizard's publisher had prevailed. Asda issued an unreserved apology for the statement, which was made by its director of general merchandise, Peter Pritchard, and removed it from its website, having earlier also settled the outstanding debt. The book will go on sale in its 340-plus stores.

"We look forward to a good relationship with Bloomsbury going forward," the firm said in a statement, "including selling the latest Harry Potter book from 0001 BST on Saturday July 21, and many other Bloomsbury books in the future."

Minna Fry, marketing director of Bloomsbury, said: "We are pleased this situation has been resolved and look forward to working with Asda in the future."

The spat has arisen because of the intensely aggressive competition between retailers over the sale of the novel, which has driven prices in the major retailers to less than half that recommended by the publisher. Bloomsbury's RRP for the book is £17.99; Asda, like Tesco, will be selling it for less than half price.

At that level both are losing money on each copy of the book, which sells wholesale at around £10.74 a copy. No major retailer can afford not to sell the book at a loss: Waterstone's, Amazon and WH Smith will charge £8.99.

A spokesman for Waterstone's said pricing the book competitively encouraged new readers into bookshops. "You can't look at this as just one book," he said. "People will be buying more than one book, and it brings people into bookshops who do not normally come in. Each Harry Potter book is a long-term prospect, not just a one-day wonder."

Bloomsbury argued that £17.99 was a reasonable price for the hardback novel, which runs to 608 pages, and that Asda's comparison with the first book in the series was mischievous. Harry Potter and the Philosopher's Stone, released with an RRP of £11.99 a decade ago, had 223 pages. The publisher is known to be unhappy about major retailers selling the book as a loss leader.

Joel Rickett, the deputy editor of the Bookseller, described the confrontation as "quite extraordinary". "It really shows the strength of the underlying resentments between the big publishers and the most aggressive discount retailers. These tensions have been building for years, but this specific row is absolutely amazing, the fact that Bloomsbury has been bold enough to threaten not to supply any books to Asda."

Publishers have felt increasingly assailed by discount retailers attempting to use their financial muscle to negotiate better deals, he said. "Asda has been in protracted negotiations with a lot of publishers trying to negotiate new payment frameworks, and Bloomsbury has angered them by having no flexibility.

"Independent bookshops, of course, argue that the overall structure is unfair because there is no way they can compete. It is heartbreaking that some small booksellers lose money on what is the biggest publishing phenomenon of their lifetime."

More than 3m books are believed to have been supplied for what will almost certainly be the biggest book launch ever. The last Potter book sold almost 2m copies in its first 24 hours - more than The Da Vinci code sold in a year.

Asda v Bloomsbury

AsdaHistory Founded as Associated Dairies and Farm Stores in 1949; became Asda in 1965 after merging with the tiny Asquith supermarket chain (the name is a conflation of the two firms' titles). Struggled in the early 1990s, but was revived under the chairmanship of Archie Norman, later a Conservative MP. In 1999 it was taken over by the US supermarket giant Wal-Mart and it is now the second biggest supermarket chain in the UK after Tesco.

Successes George Davies, founder of Next, launched the successful George at Asda range of clothing; it is worth £1.75bn alone, and is the fourth biggest clothing retailer in the UK.

Blunders Fined £850,000 in 2006 after illegally offering staff at a distribution depot a pay rise if they would give up their union rights. The PR chief of parent company Wal-Mart was forced to resign in 2005 after the firm issued an ad comparing itself to victims of the Nazis in a dispute with local government. In 2004 Asda apologised after decorating one of its stores in Cardiff with enormous England flags in advance of the European football championship.

BloomsburyHistory Founded in 1986 with £2m of venture capital, and run from a tiny office above a south-west London Chinese restaurant. Explicitly set up in an attempt to do publishing differently: the four founders established a trust and gave 5% of the firm to its writers. When it floated in 1993 its 344 authors received up to £20,000 each.

Successes Has always had a respectable roster of writers, including Margaret Atwood, Michael Ondaatje and John Irving. But JK Rowling's phenomenal success has dwarfed them all; as much as half of Bloomsbury's business is now Potter-related

Blunders Vast wealth generated by the Potter franchise has led to some arguably ill-considered advances. David Blunkett's memoirs in 2005 became a cautionary tale in the industry: he was paid a rumoured £400,000 but the book sold in the low four figures.