The Harry Potter author was revealed as writing under the false identity of male writer 'Robert Galbraith' in penning crime novel 'The Cuckoo's Calling'.
She found out the leak came from law firm Russells, whom she had assumed she "could expect total confidentiality from".
"I feel very angry that my trust turned out to be misplaced. To say that I am disappointed is an understatement," she said in a statement.
Russells Solicitors said it apologised "unreservedly".
More From This Section
In a statement, it said the wife of one of its partners, Chris Gossage, had told her best friend, Judith Callegari, that Robert Galbraith was really Rowling, The BBC reported.
The company said it was revealed "during a private conversation", adding that "the disclosure was made in confidence to someone he trusted implicitly".
"Whilst accepting (Gossage's) own culpability, the disclosure was made in confidence to someone he trusted implicitly. On becoming aware of the circumstances, we immediately notified JK Rowling's agent," Russells said.
There had been speculation leaking the name was part of a publicity campaign.
However Russells said, "We can confirm that this leak was not part of any marketing plan and that neither JK Rowling, her agent nor publishers were in any way involved."
The Cuckoo's Calling, believed to be the debut novel of Galbraith, tells of war veteran-turned private investigator Cormoran Strike and received good reviews when it was first published.
When she was revealed as Galbraith, Rowling said she had found writing under a pseudonym "a liberating experience".
She had issued a statement saying she had "hoped to keep this secret a little longer" but added it had "been wonderful to publish without hype or expectation, and pure pleasure to get feedback under a different name".