More than 50 years have passed since Harper Lee published To Kill a Mockingbird, her gripping novel about racial injustice in deeply segregated Alabama. Now the town where Lee was born and raised, and which served as the inspiration for her best-selling book, has once again become the scene of an unsettling legal dispute that has divided the community.

This time Lee, who at 87 is profoundly deaf and almost totally blind, is not the author of the story but – on the surface at least – its protagonist.

In a move which has shocked Monroeville, Lee, who resides in an assisted-living facility in the town, is bringing a lawsuit against the local museum, accusing the small, not-for-profit institution of exploiting her fame and the prestige of her Pulitzer-winning book without offering compensation. The museum is fighting back, condemning Lee’s lawsuit as “false” and “meritless” and warning that the legal action could destroy an institution that honours the author's legacy and provides an economic boost to the town.

It is the kind of ugly public dispute that Lee, an intensely private figure who has spent her life avoiding the spotlight, might have been expected to avoid. Unsurprisingly, Monroeville has been awash with with rumour about whether Miss Nelle, as the author is known locally, was personally responsible for the decision to sue the museum.

The answer to that question is complicated, but it appears to involve Lee’s 102-year-old sister, Alice, and a close associate, an attorney who happens to be married to a relative of Truman Capote.

Capote is the other literary great who spent much of his childhood in Monroeville, living in a house next-door to Lee. The pair became close friends and Lee famously assisted Capote when he researched the Kansas murder that formed the basis of another classic, In Cold Blood.

Both Lee and Capote are honoured in the Monroe County Heritage Museum, which attracts 30,000 visitors a year. Most come in April and May, when the restored 1903 courthouse, which served as a model for the To Kill a Mockingbird movie, starring Gregory Peck, becomes the backdrop for a theatrical production of Lee’s novel.

Facebook Twitter Pinterest Harper Lee with Gregory Peck, the star of the 1962 adaptation of To Kill a Mockingbird. Photograph: Bettmann/Corbis

Lee’s only published novel is one of the great works of 20th century literature. It has sold 30 million copies and, according to her lawsuit, is on the required reading list for more than three-quarters of American high schools. The book is set in the 1930s in the fictional town of Maycomb, a place almost indistinguishable even today from Monroeville, a place of 6,500 people which adheres to Lee’s description of “an island in a patchwork sea of cotton fields and timber land”.

The extent to which Lee’s novel is an accurate reflection of her upbringing in the town is the source of much debate – and is likely to feature in the legal case. Lee's legal complaint recognises that the book was “inspired by Ms Lee’s home” in Monroe County, but adds: “Nonetheless, the setting, plot and characters are products of Ms Lee’s imagination.”

On 19 August, her lawyers filed a trademark application. The museum filed an opposition, prompting the lawsuit served on 15 October, which takes issue with the museum’s website and gift shop, which it accuses of “palming off its goods”, including t-shirts, coffee mugs other various trinkets with Mockingbird brands. The museum says the gift shop generates a paltry $28,000 a year, and helps employ a few “pitifully paid” people from the town.

The lawsuit even takes a swipe at Monroeville, saying the “desire to capitalize” on the fame of Lee’s book is evident in the town’s choice of logo: a mockingbird and the cupola of the Old County Courthouse.

Yet Lee, who stopped granting full interviews in 1964, has herself made clear that To Kill a Mockingbird was partly rooted in the Monroeville she knew. Her father, Amasa Coleman Lee, was, like the novel’s Atticus Finch, a local attorney and state senator. There are obvious streaks of Lee in the young female narrator of the story, Scout, and her close friend Dill appears at least loosely based on Capote.

“It is and it isn’t autobiographical,” Lee told the New York Herald Tribune in 1962. “The trial, and the rape charge that bring on the trial, are made out of a composite of such cases and charges. What I did present as exactly as I could were the clime and tone, as I remembered them, of the town in which I lived. From childhood on, I did sit in the courtroom watching my father argue cases and talk to juries.”

Harper Lee in the Monroeville courthouse. Photograph: Donald Uhrbrock/Time & Life Pictures/Getty Images

For much of the last quarter of a century, Lee appears to have had an ambivalent view of the museum. Instinctively uncomfortable with anything that brings unwanted attention, she is once said to have complained about the “cottage industry” that has grown around the novel. But until now, the only time she is known to have expressed that view to the museum was in 2002, when it published a cookbook based on the character Calpurnia – an incident mentioned in the lawsuit.

According the museum, when Lee said that she wasn’t happy, they quickly removed Calpurnia’s Cookbook from the shelves – copies are still stored in the attic.

On the other hand, there is evidence the museum has had the tacit blessing of Lee’s family and friends. A plaque on the wall bears the name of the author’s nephew, Dr Edwin Lee, a local dentist. Some of those closest to Lee, including a lifelong friend, the Reverend Dr Thomas Lane Butts, have served on the museum’s board. And three years ago – on the 50th anniversary of the novel’s publication – Lee herself visited the museum, with the Hollywood actress Patricia Neal. When the museum sent Lee flowers, she replied with a note which read: “My dearest friends, the roses are spectacular and I love them, sincerely yours, Nelle Harper Lee.”

Since then, Lee’s health has deteriorated. Her infirmity partly explains a second, unrelated lawsuit that the author brought earlier this year against her literary agent. In that case, Lee’s lawyers claimed Samuel Pinkus, the son-in-law of the writer’s long-time agent, Eugene Winick, had duped Lee into signing over the copyright on the book. The case was settled two months ago.

Until 2011, Lee’s financial interests had long been protected by her sister, Alice, who was herself profoundly deaf, and relied upon lip-reading. Now 102, Alice Lee is, like her sister, known as a formidable character in town, having practiced law with the venerable Barnett, Bugg, Lee and Carter law firm.

The Carter in that firm is Tonya Carter, the lawyer most people in Monroeville seem to think has been given power of attorney by Harper Lee. There is no known documentary evidence to support that suggestion, and Carter has not responded to requests for comment. But two sources close to Lee confirmed that Carter had indeed been given power of attorney by the author.

Carter is also a well-known figure in Monroeville. She is married to Patrick Carter, a pilot who happens to be a cousin to Capote, and the couple run a restaurant, Prop and Gavel, a stone’s throw from the museum. With resentment over the lawsuit running high, some locals say they are boycotting Carter’s restaurant in protest. That may be unfair. Even if Carter does have power of attorney over Lee’s business affairs, she may still be acting on explicit instructions from Lee – or at the very least consulting with the author.

Gregory Peck, as Atticus Finch, argues his case. Photograph: Sportsphoto Ltd/Allstar

Legal papers submitted in the lawsuit filed against Lee's literary agent, in May, said that while the author's physical health had seriously deteriorated since a stroke in 2007, it had not affected her “mental capabilities”.

But in a small town like Monroeville, it does not take long for ill-feeling to spread. The lawsuit, much like the fictional rape trial Lee portrayed in To Kill a Mockingbird , is forcing locals to take sides.

Stephanie Rogers, 29, the museum's executive director, talks of two “camps” emerging in Monroeville, but insists most people are behind the museum. “I haven’t heard anything else the other way,” she said. But dissenting voices can be heard, even if they are whispered. In the Courthouse Cafe, across the road, a hushed debate was recently overheard.

“The thing about small towns like this: everybody will put a foot in if they think they can make a dollar,” a woman said. “I think it is bad that they’re acting like Harper Lee don’t exist.”

Additional reporting by Verna Gates in Monroeville