Heirs to a Manhattan real estate fortune will have to fork over $44 million to a law firm for just five months of work​ ​– because their mother was such a difficult client, the state’s highest court ruled.

Alice Lawrence “was no naif,” Judge Susan Philips Read wrote for the majority in the Court of Appeals decision awarding the whopping legal fee.

Alice, an 81-year-old widow of real estate magnate Sylvan Lawrence, died in 2008, three years into a bitter fee dispute with her​​ longtime law firm, Graubard Miller.

A lower court had slashed the fee to $15.8 million finding that its “sheer size” was disproportionate “to Graubard’s efforts.”

The firm appealed and the family’s attorneys argued that a Graubard lawyer named Daniel Chill had a “svengali-like” influence over their elderly mother.

The family got a second court, the Appellate Division, to cut the payout even further, down to $2 million.

Sylvan Lawrence, the late husband of Alice Lawrence (also deceased), outside the Roosevelt Hotel in 1962.

Graubard appealed again, and this time, won.

The Court of Appeals said that the octogenarian described herself as “a force to be reckoned with” and someone who “never” consulted her attorneys.

Indeed, “she demanded to be the ‘senior partner’ in the litigation against her late husband’s brother and lifelong business partner Seymour Cohn.

Cohn was the executor of his brother’s estate and had resisted selling buildings and handing over the cash to Alice and her children.

Alice also “threatened on numerous occasions to fire Graubard,” the decision states.

Read’s ruling also paints Alice as greedy.

When Graubard won a $111 million settlement from Cohn in 2005, “Lawrence, whose net worth was already about $220 million before this distribution, was so delighted that she framed copies of the checks,” Read writes.

The $44 million was an agreed upon contingency fee, equal to 40 percent of any payout.

Graubard argued that it “doggedly” pursued evidence that Cohn had engaged in self-dealing in the sale of several properties. The digging uncovered “smoking gun” evidence that led to Cohn’s offer, the decision notes.

“The value of Graubard’s services should be the $111 million recovery it obtained for Lawrence,” Read writes.

She adds, “It is in the nature of a contingency fee that a lawyer, through skill or luck (or some combination of thereof), may achieve a very favorable result in short order.”

“Conversely, the lawyer may put in many years of work for no or a modest reward,” Read concludes.