LONDON -- Author J. K. Rowling accepted an apology and a charitable donation yesterday from a law firm that revealed she wrote a crime novel under a pseudonym.

The "Harry Potter" author was exposed by a newspaper on July 14 as the author of "The Cuckoo's Calling," a thriller ostensibly written by a former soldier and first-time novelist, Robert Galbraith.

The book was published in April to good reviews but modest sales, and there was speculation that Rowling or her publisher had leaked the news to raise the book's profile. But the law firm Russells, which has done work for Rowling, acknowledged that one of its partners had let the information slip to his wife's best friend, who tweeted it to a Sunday Times columnist.

Rowling sued the lawyer and the friend. Her attorney, Jenny Afia, told Britain's High Court that Rowling had been left "angry and distressed that her confidences had been betrayed." "As a reflection of their regret for breach of the claimant's confidence, including frustrating the claimant's ability to continue to write anonymously under the name Robert Galbraith, the defendants are here today to apologize publicly to the claimant," Afia said.

Russells agreed to reimburse Rowling for her legal costs and to make a "substantial" donation to The Soldiers' Charity, which helps former military personnel and their families. Rowling said she was donating all royalties from the book for the next three years to the charity.

advertisement | advertise on newsday

The hero of her novel, Cormoran Strike, is a veteran who lost a leg in Afghanistan. Rowling has said she drew on conversations with soldiers and veterans to create the character.

The writer said she had always intended to give part of Galbraith's royalties to the organization, "but I had not anticipated him making the best-seller list a mere three months after publication -- indeed, I had not counted on him ever being there!" Since Rowling was outed as the author, "The Cuckoo's Calling" has topped best-seller lists in Britain and the United States.