British writer J.K. Rowling on Wednesday accepted a large donation to charity from the law firm that revealed that she was Robert Galbraith, the author of the detective novel "The Cuckoo's Calling."

The Harry Potter creator had sued the Russells law firm after one of its partners, Chris Gossage, told his wife's best friend that Robert Galbraith was Rowling's pen name.

The woman sent a Twitter post a few days later to a columnist for "The Sunday Times," triggering a wave of publicity that sent sales of the crime novel skyrocketing.

Rowling was disappointed by the revelation of her secret and sued the Russells firm for violating client confidentiality.

The 48-year-old writer accepted an apology from the law firm accompanied by a "substantial" donation to The Soldiers' Charity, a non-profit organization that assists former military personnel and their families.

The main character in "The Cuckoo's Calling" is a former soldier who becomes a private detective.

Rowling developed tremendous respect for military personnel while researching and writing the novel.

The worldwide royalties from sales of the detective novel will be donated to the charity for three years effective July 14, the day she was revealed to be the author of "The Cuckoo's Calling," Rowling said in a statement.

"This donation is being made to The Soldiers' Charity partly as a thank you to the Army people who helped me with research, but also because writing a hero who is a veteran has given me an even greater appreciation and understanding of exactly how much this charity does for ex-servicemen and their families, and how much that support is needed," Rowling said.

The novel, which was published in April, was praised by critics but garnered little attention in the media until Rowling's authorship was revealed.

"The Cuckoo's Calling" quickly climbed the sales list on Amazon after it was revealed that Rowling was the author, and the e-book version topped the bestseller list.

Sphere, an imprint of Little, Brown Book Group that published Rowling's first adult novel, "The Casual Vacancy," last year, published the crime novel.

Rowling wrapped up the Harry Potter series, which has sold more than 450 million copies, in 2007. EFE