JERUSALEM — An Israeli court has ruled the literary estate of Max Brod, including the writings of his friend Franz Kafka, will be transferred to Israel's national library, after more than four decades in private hands.

In a Tel Aviv family court ruling seen published on Sunday, justice Talia Kopelman-Pardo said the Brod collection should be handed to the Hebrew University's library, as per its demand, after establishing that that was the original intent of Kafka's friend.

Prague-born Kafka entrusted all his manuscripts and works to Brod and instructed him to burn them after his death, which occurred in 1924 at the age of 40.

However, Brod ignored Kafka's wishes and instead published the German-language works, considered among the most influential literature of the 20th century.

In 1939, Brod fled to British-ruled Palestine and upon his death in 1968 bequeathed his collection, including unpublished writings by Kafka, to his secretary Esther Hoffe.

The court found that in his will Brod explicitly ordered Hoffe to catalogue and transfer his collection "to the library of the Hebrew University in Jerusalem or the Tel Aviv municipal library, or (that of) any other public institution in Israel or abroad."

But Hoffe failed to do so, keeping the bulk of the collection locked away in private banks and selling parts of it.

Some of his writings ended up in the collection of the German Library Archive in Marbach -- which was also part of the process, demanding to be allowed to purchase more Kafka writings.

The Brod collection was passed on to Hoffe's two daughters in 2007, who at the start of the trial in 2008 argued Brod's intention was to make the collection, including the Kafka writings, a gift to their mother, and hence lawfully theirs.

One of the daughters passed away earlier this year.

Kopelman-Pardo, however, ruled that "the Kafka writings, like the Brod collection," could not be considered a gift to Hoffe's daughters.

"The Brod collection should be handed to the archive," she wrote of the national library.

National library director Oren Weinberg praised the ruling in a statement in which he pledged to eventually post the collection online "thus fulfilling Brod's wish of publishing Kafka's writings for all literature lovers in Israel and the world."