Former President Jimmy Carter , the Georgia peanut farmer whose one term in the Oval Office was plagued by problems at home and abroad but who was awarded the Nobel Peace Prize after he left office, died Sunday in Plains, Ga.

He was 100 years old, the longest-lived former president in the country’s history. He had been in hospice since February 2023. The Carter Center confirmed his death.

The 39th president’s sole term in office was marred by a listless economy and stubborn inflation, squabbles within his party, gridlock in Congress and the seizure of American hostages in Iran. Considered a long-shot Democratic candidate when he announced his bid, Carter would broker a historic peace treaty between Israel and Egypt and set in motion other changes that would dominate global politics in subsequent years.

Many of the achievements for which he was recognized came after he left office in January 1981. He was the most active former president in modern U.S. history, gaining renown for work over four decades monitoring elections around the world, fighting neglected diseases, working to raise living standards for the poor and advocating for human rights. He did much of this work through the Carter Center, the humanitarian nonprofit he founded with his wife, Rosalynn Carter , in 1982.

Jimmy Carter

FILE PHOTO: Former U.S. President Jimmy Carter attends the starting day of the 24th Jimmy Carter Work Project in Los Angeles, California, U.S. October 29, 2007. REUTERS/Mario Anzuoni/File Photo

“Jimmy Carter will probably not go down in American history as the most effective president. But he is certainly the best ex-president the country ever had,” said Gunnar Berge of the Norwegian Nobel Committee in his 2002 speech presenting Carter with the peace prize.

James Earl Carter Jr. was born Oct. 1, 1924, in the small town of Plains. A religious Baptist, he grew up on his family’s farm in a home that didn’t have plumbing, electricity or insulation when he was a boy. He graduated from high school at age 16 and attended college for two years in Georgia before enrolling at the U.S. Naval Academy, from which he graduated in 1946. As a young naval officer, he worked on the nascent nuclear submarine program.

After he graduated, Carter married Rosalynn Smith, his hometown sweetheart. In 1953, his father died of pancreatic cancer. Carter left the Navy and moved home to Plains to take over the family farm, a decision that left his young wife “astounded and furious,” according to his memoir, “A Full Life: Reflections at Ninety,” published in 2015.

Carter became a successful peanut farmer and community leader, and in 1962 he was elected to the Georgia State Senate. After a failed bid for governor in 1966 against the avowed segregationist Lester Maddox, Carter was elected to the post in 1970. Though he had been coy about his view toward segregation during his campaign, Carter declared at his inauguration on Jan. 12, 1971, that “the time for racial discrimination is over.” That declaration put him on the cover of Time magazine and vaulted him to national prominence as a harbinger of the post-racial New South.

Carter was a popular figure at the Democratic National Convention in 1972 and decided to run for president by the time he left the governor’s office in 1975. Considered a long-shot candidate in a crowded Democratic field for the 1976 nomination, he campaigned extensively door to door, presenting himself as a Washington outsider, an appealing attribute to voters after the Watergate scandal.

Patrick P. O’Carroll Jr., a former inspector general for the Social Security Administration, was a young Secret Service agent in 1975 when he was assigned to Carter’s campaign detail. O’Carroll had no idea who Carter was, he said.

FILE PHOTO: President Jimmy Carter at the White House, in Washington, U.S. March 8, 1977. Library of Congress/Marion S. Trikosko/Handout via REUTERS/File Photo THIS IMAGE HAS BEEN SUPPLIED BY A THIRD PARTY.

O’Carroll, who grew up in the Washington area, was suddenly working in tiny Plains and living with other agents in a nearby hotel. He said early events on the campaign trail were relatively easy because “for the most part nobody knew who the hell he was so that makes it a lot easier to protect him.”

Carter joined the campaign staff and agents’ softball team as the pitcher against a reporters’ team.

Carter’s broad smile and soft Southern accent offered a hopeful contrast to the dour, combative politics then dominating a post-Watergate Washington. One political button during the race showed a smiling peanut and the slogan, “The Grin Will Win.”

Carter professed his evangelist Christianity on the campaign trail but also presented himself as honest and flawed, acknowledging in a Playboy magazine interview that “I’ve committed adultery in my heart many times.”

Carter’s campaign was aided early on by support from various popular rock bands at the time, including the Georgia-based Allman Brothers Band. The band raised money for him at concerts and promoted his name across the country.

Behind the folksy demeanor, Carter was known as a shrewd and hardworking tactician, who, with the close and constant assistance of Rosalynn Carter, turned his campaign from a dark horse into a juggernaut overcoming better-known rivals seeking the Democratic Party nomination, such as then-California Gov. Jerry Brown and Arizona Rep. Mo Udall.

Early supporters of Carter outside of Georgia included Delaware Sen. Joseph Biden—and the two became lifelong friends.

Carter went on to win a general election over Republican President Gerald Ford, and he set a new tone right away. Carter was the first president to exit his motorcade and walk a portion of Pennsylvania Avenue on the way to the White House after being inaugurated. Among his first acts in office was to send a message to nations around the world that the U.S. would “not seek to dominate or dictate to others.” He also pardoned Americans who had fled the country to escape the draft during the Vietnam War.

Carter’s optimistic intentions withered in the face of domestic political wrangling, economic problems, fuel prices and international crises. Inflation, high energy costs and periods of relatively high unemployment beset his presidency.

In a speech in 1977, he addressed the nation about the energy crisis. Wearing a tan cardigan sweater and sitting next to a fireplace, he urged Americans to turn down their thermostats to “65 degrees in the daytime and 55 degrees at night” to help ease a shortage of natural gas. Some criticized Carter’s speech as lecturing, not leading.

In 1979, Carter gave a televised speech that was supposed to bolster the nation’s sagging morale. He said the nation was suffering from “a crisis of confidence,” a phrase his political opponents quickly used against him.

FILE PHOTO: Former U.S. President Jimmy Carter attends a Habitat for Humanity home building site in the Ivy City neighborhood of Washington, October 4, 2010. REUTERS/Larry Downing/File Photo

Critics who saw Carter as a weak leader complained about events small and large. They mocked him for an incident in early 1979 when a rabbit swam toward the president’s canoe while he was fishing near his home in Plains. The president used a paddle to splash at the rabbit, which swam away, but critics called the president’s response timid.

Beginning in late 1979, the Soviet Union invaded Afghanistan. Carter organized a grain embargo against the U.S.S.R. and the U.S. boycotted the 1980 summer Olympic Games. Carter’s opponents said the actions were ineffective at halting the Soviet occupation.

But he had some notable successes in foreign affairs, including the Camp David Accords. Signed with Israeli Prime Minister Menachem Begin and Egyptian President Anwar Sadat , they reshaped the Middle East by bringing a lasting peace to two hostile nations. And domestically, the president was able to push deregulation of airlines, railroads and other industries. He signed a law establishing the Energy Department to regulate existing sources of energy and fund research into new sources and other technologies.

But his administration was troubled with foreign-policy quagmires. Most notably, after Carter allowed the dethroned shah of Iran to come to the U.S. for medical treatment in 1979, a group of Iranian students invaded the U.S. Embassy in Tehran, taking 66 diplomats, military personnel and workers hostage.

Despite diplomatic efforts, the Iranians held 52 of the hostages throughout the rest of Carter’s presidency, releasing them only after Ronald Reagan , a Republican, had been sworn in as president. A rescue attempt by U.S. armed forces failed after some of the helicopters sent into Iran had mechanical problems. After the mission was aborted, a helicopter preparing to leave a staging area in Iran crashed into a transport plane, killing eight U.S. servicemen.

Asked in 2015 what major regrets he had in his life, Carter said, “I wish I’d sent one more helicopter to get the hostages, and we would have rescued them, and I would have been re-elected.”

Carter’s problems were compounded by his fights with members of his own party, including Sen. Edward Kennedy , who eventually decided to oppose him for the Democratic presidential nomination in 1980.

Carter won the nomination after a bitter primary fight, but he lost badly to Reagan, carrying only six states and the District of Columbia, while Reagan carried 44. It was one of the worst defeats for a president in U.S. history.

After his loss, a stung Carter returned to Plains and began a new chapter in his life, writing books , monitoring more than 100 elections, taking on the eradication of diseases such as Guinea worm, and helping build thousands of houses with the charity Habitat for Humanity. He taught Sunday school regularly at his church in Plains and built furniture in a woodworking shop in his garage, auctioning it to raise funds for the Carter Center.

Carter was driven, often as though he was trying to overcome the regrets and failures of his presidency. He led teams of observers to monitor fair elections in dozens of countries, from Bolivia to Zambia. He worked for years on diplomatic missions for Republican and Democratic presidents in Bosnia, Haiti and elsewhere.

When tensions rose between the U.S. and North Korea over that country’s nuclear program in 1994, Carter flew to Pyongyang as a private citizen and reached an agreement between the two countries to avoid war. But he was also quick to openly criticize U.S. policies he opposed. He irked the administration of George H.W. Bush by opposing its plans to go to war with Iraq over the invasion of Kuwait, arguing that such a war would be devastating to the Middle East.

Jimmy and Rosalynn Carter threw their energy into fighting diseases that had been all but forgotten in the developed world—trachoma, river blindness , Guinea worm and others—traveling to cities and remote villages to promote Carter Center programs. The center treated millions of people and brought better surveillance and healthcare systems to poor countries. When it began the effort to eradicate Guinea worm in 1986, there were 3.5 million cases of the disease. In 2023, there were 14 human cases, near 2022’s record low of 13 human cases. The disease is now close to becoming the second human disease to be eradicated, after smallpox, according to the Carter Center website.

In 2015, Carter said Guinea worm eradication was one of the things that he hoped for most. “I’d like the last Guinea worm to die before I do,” he said.

Carter was shaped in part by his military-officer training. He was habitually curious on a range of subjects, from peanut-farm operations to nuclear-weapons treaties, from knotty questions of theology to cures for stubborn diseases.

“People did not realize he is a true polymath,” said Dr. William Foege, who was director of the Centers for Disease Control and Prevention under Carter, and later executive director of the Carter Center. “There was no subject he was not interested in….I’ve never seen anyone who uses time as well as he does.”

On trips to Africa, staff would get worn out long before he did, and by the time everyone got going in the morning, “he and Rosalynn had been up jogging and bird-watching,” Foege said.

Carter could be a tough boss. He was known for grilling staff on briefing memos, said Dr. Frank Richards , a senior adviser to the Carter Center who ran several of its disease programs for 15 years. On one trip during his postpresidency, Richards recalled, Carter summoned Richards on a flight in the middle of the night to his seat, the only one in business class with the reading light on. He went through the talking points in Richards’s memo with him one by one. When he was finished, “he said OK, thank you, bye.”

Carter said that his postpresidency, and specifically his work at the Carter Center, had been “far more gratifying personally” than his years in the White House. He was awarded the Nobel Peace Prize in 2002 for his work to resolve international conflicts, and to promote democracy, human rights, and economic and social development.

“He really remade the postpresidency,” said Julian E. Zelizer, a Carter biographer and a Princeton University history and public-affairs professor. Carter transformed his center into “a mini-White House of sorts where he could work on global affairs.”

Carter remained consumed in his postpresidential years with Middle East peace. But he angered supporters of Israel and that country’s leadership by arguing that the Palestinians were being mistreated by Israeli authorities. In his 2006 book, “Palestine: Peace Not Apartheid,” he argued that the desire of some Israelis to colonize Palestinian lands prevented an overall peace agreement in the Middle East.

Despite his hectic schedule and celebrity status, Carter often volunteered with his church, the Maranatha Baptist Church in Plains. He delivered what he described as “Sunday school” talks that drew thousands to the small church set in a pecan-tree grove. People would line up in the early morning hours to get a chance to get in the church.

Carter was also known to handle other duties there including mowing the lawn. Once on a trip to visit him in Plains, Foege noticed Carter’s upper lip was swollen. The former president said he had cut his lip on the riding lawn mower when he ducked to avoid a tree limb. “Here you have an ex-president doing janitorial work,” Foege said.

Carter became known for shaking the hands of every passenger when he boarded a commercial flight. When stumping for other Democrats, including his grandson Jason Carter, who unsuccessfully ran for Georgia governor in 2014, he would spend hours shaking hands and posing for photographs.

In August 2015, at the age of 90, Carter disclosed he had been diagnosed with metastasized cancer in his liver and brain. It was a rare and serious form of melanoma that had invaded his internal organs. Carter cut back on his busy schedule and underwent treatment at Emory University in Atlanta that included radiation and immunotherapy, as well as surgery to remove the tumor on his liver. He and his doctors later said he had beaten back the malignancies.

Carter returned to his work at his center as well as volunteering for Habitat for Humanity. He continued his regular Sunday talks at Maranatha Baptist Church in Plains, which drew people from all over the country and beyond.

Pondering his life as he was diagnosed with cancer, Carter said he was accepting of his condition and was buoyed by his deep religious faith.

“I’ve had a wonderful life,” he said.

Carter remained active in his 90s, making public appearances. Out of concern over the pandemic, he didn’t attend President Biden’s inauguration in January 2021, and instead released an audio statement in support of the incoming president. The Bidens visited the Carters several months later in Plains. In March 2023, Biden said he had recently visited the Carters again, and Carter had asked him to deliver the eulogy at his funeral.

The Carters had three sons, Jack, Donnel and James, and one daughter, Amy, who spent part of her childhood in the White House. Carter is survived by his children, as well as many grandchildren and great-grandchildren. On May 30, 2023, the Carter family issued a statement that Rosalynn Carter had dementia. She died on Nov. 19, 2023. Carter attended his wife’s funeral in a wheelchair. On Oct. 1, 2024, Carter turned 100, with Biden and others paying tribute. On Oct. 16, Carter, who had told his family he wanted to live long enough to vote in the presidential race, cast an early ballot by mail, according to the Carter Center.

Write to Cameron McWhirter at Cameron.McWhirter@wsj.com and Betsy McKay at betsy.mckay@wsj.com