As tributes poured in from abroad, Israel prepared to say goodbye to Shimon Peres, one of the founders of the Jewish state, who died Wednesday of complications from a massive stroke.

For many, Peres’s long and complex legacy reads like chapters from Israel’s history.

The 93-year-old — a former prime minister and president and a Nobel Peace Prize laureate — died at a Tel Aviv hospital surrounded by his family.

His body will lie in state at the Israeli parliament Thursday, allowing the public to pay their respects. Many world leaders and dignitaries — including President Obama, former president Bill Clinton, Canadian Prime Minister Justin Trudeau and Prince Charles — are expected to attend his funeral Friday in Jerusalem. The White House said Obama will depart Thursday for Jerusalem and return Friday after the service.

Peres arrived in British Mandate Palestine as a boy from what was then Poland and is now Belarus. He began more than six decades of public service as a security hawk who helped turn Israel into a nuclear power, only to become the ultimate dove, pushing until the end for peace with the Palestinians.

At the Sheba Medical Center, his son Chemi Peres said, “The loss we feel today belongs to all of Israel. We all share this pain.”

Until Tuesday, doctors had expressed guarded optimism that he might recover from the stroke he suffered Sept. 13, but his condition deteriorated quickly.

The family said Peres wanted any useful organs donated for transplant. His corneas were removed.

His son-in-law and personal physician, Rafi Walden, said Obama called the family and spoke with Peres’s daughter to express condolences.

Education Minister Naftali Bennett directed that all of Israel’s schoolchildren dedicate a portion of the day Thursday to the study of Peres’s life.

Social-media sites were filled with Peres quotes Wednesday.

“Optimists and pessimists die the same way. They just live differently,” he said in 2005.

“My greatest mistake is that my dreams were too small,” he concluded during a TED talk in Tel Aviv in 2015.

Abroad, Peres was best known as Israel’s elder statesman, the grandfatherly figure who liked poetry and a glass of wine — a leader hailed for his optimism, vigor and pursuit of a deal between Israel and the Palestinians, who seek an end to the almost 50-year military occupation and the creation of a sovereign state.

At home, Peres was most beloved in his later years, especially during his term as president, a largely ceremonial post. But his legacy is complex in Israel.

Many Israelis have turned away from Peres’s signal achievement, the crafting of the 1993 Oslo Accords, the beginning of what has become a faltering peace process with the Palestinians.

Peres shared the Nobel Peace Prize in 1994 with Israeli Prime Minister Yitzhak Rabin and Palestine Liberation Organization leader Yasser Arafat for the peace accords.

Peres’s tenure in power lasted through 10 U.S. presidents.

In an unusually personal statement, Obama said that no Israeli did more over so many years than Peres to build the alliance with the United States.

“I will always be grateful that I was able to call Shimon my friend,” Obama said. “Perhaps because he had seen Israel surmount overwhelming odds, Shimon never gave up on the possibility of peace between Israelis, Palestinians and Israel’s neighbors — not even after the heartbreak of the night in Tel Aviv that took Yitzhak Rabin.”

Rabin was assassinated by a Jewish extremist in 1995 as he worked to build a lasting peace with the Palestinians. Peres succeeded Rabin as prime minister, one of three times he held the post.

“I’ll never forget how happy he was 23 years ago when he signed the Oslo Accords on the White House lawn, heralding a more hopeful era in Israeli-Palestinian relations,” Clinton said in a statement.

“His critics called him a dreamer. That he was — a lucid, eloquent dreamer until the very end,” Clinton added.

A campaign aide to Hillary Clinton said she will not attend the funeral. The Democratic presidential nominee plans to be at events in New Hampshire, Iowa and Florida this week.

Yoram Dori, a close friend and former adviser to Peres, said that what drove the Israeli leader, even after numerous setbacks, was that he considered his fellow Israelis family.

“He would say to me, ‘Yoram, do you ever quit your family? Your concern until your last breath is your family and you will do everything you can to help your family, and my family is the state of Israel,’ ” Dori said.

Prime Minister Benjamin Netanyahu noted that Peres was always dedicated to Israel’s security. “He strengthened Israel in many ways, some of which are still secret,” said Netanyahu, who as a leader of the Likud party was often a political rival of Peres and his Labor Party.

Former Israeli lawmaker Einat Wilf, who served as a foreign policy adviser to Peres, said that as a politician, Peres was not always popular in Israel, especially because he was so opinionated. She said he kept his Polish accent until his last day and was often viewed as an outsider in a country he helped build.

Frederic C. Hof, a former U.S. diplomat, observed that Peres “could be stubborn, didactic and irascible.” His feuds and maneuverings were legendary. But, in the end, the legacy of this “immensely talented, engaging and inventive man will depend on the efforts of others who will either build upon his good works or abandon them entirely,” Hof said.

Among Arabs, especially, Peres remained a controversial figure for his role in fostering Jewish settlements in the occupied territories and his leadership during a deadly attack on a U.N. base in southern Lebanon in 1996.

On social media, supporters of the Palestinians warned that glowing obituaries were a whitewash. They called Peres “a war criminal” who had “blood on his hands.”

Diana Buttu, a lawyer and former peace negotiator for the PLO, tweeted, “For Peres, ‘peace’ meant bombing civilians, stealing land, ethnic cleansing and building settlements.”

Yet Palestinian Authority President Mahmoud Abbas tweeted in Arabic, “Shimon Peres’s death is a heavy loss for all humanity and for peace in the region.”

The official Palestinian news agency Wafa reported that Abbas had sent a condolence letter to Peres’s family.

In a speech Peres gave in 2014 upon accepting the Congressional Gold Medal, he called peace with the Palestinians “the most possible impossibility.”

Netanyahu in his last reelection bid famously vowed that no Palestinian state would be created on his watch. He later said that the time just wasn’t right. Netanyahu frequently disparages Abbas and accuses him of inciting violence and shirking negotiations.

But Peres disagreed. He called Abbas “clearly a partner for peace.” He added, “The Arabs are not Israel’s enemies. The terrorists are the enemies of both of us.”

Anne Gearan in White Plains, N.Y., and Carol Morello in Washington contributed to this report.