Barack Obama has wished Jimmy Carter a full and speedy recovery after the former US president announced that he was battling cancer.
President Obama, on holiday in coastal Massachusetts, phoned Mr Carter, 90, offering him best wishes from himself and his wife Michelle.
"Jimmy, you're as resilient as they come, and along with the rest of America, we are rooting for you," Mr Obama said in a statement.
Democrat Mr Carter, the nation's 39th president, is to undergo treatment at a hospital in Atlanta, Georgia.
He said the cancer was discovered earlier this month during surgery to remove a small mass in his liver. He said the cancer had spread to other parts of his body.
A statement from the Carter Centre makes clear the cancer is widely spread, but not where it originated, or even if that is known at this point. The liver is often a place where cancer spreads and less commonly is the primary source of it.
It said further information would be provided when more facts are known, "possibly next week".
"Recent liver surgery revealed that I have cancer that now is in other parts of my body," Mr Carter said in the statement. "I will be rearranging my schedule as necessary so I can undergo treatment by physicians at Emory Healthcare."
Mr Carter defeated Gerald Ford for the US presidency in 1976 with a pledge to always be honest. But a number of foreign policy conflicts doomed his bid for a second term and he lost to Ronald Reagan in a landslide election.
After leaving the White House, he founded the Carter Centre in Atlanta in 1982 to promote health care, democracy and other world issues, often with wife Rosalynn by his side, and won a Nobel Peace Prize in 2002.
He has completed a book tour this summer to promote his latest work, A Full Life.
In his book, Mr Carter included his family's history of pancreatic cancer, saying his father, brother and two sisters died of the disease and the trend "concerned" the former president's doctors at Emory.
"The National Institutes of Health began to check all members of our family regularly, and my last remaining sibling, Gloria, 64, was diagnosed with pancreatic cancer and died in 1990," Mr Carter wrote.
"There was no record of another American family having lost four members to this disease, and since that time I have had regular X-rays, CAT scans, or blood analyses, with hope of early detection if I develop the same symptoms."
He wrote that being the only non-smoker in his family "may have been what led to my longer life".
"Our thoughts and prayers go out to President Carter," said Dr Len Lichtenfeld, deputy chief medical officer of the American Cancer Society.
"There's a lot we don't know" but the first task will probably be determining where the cancer originated, as that can help determine what treatment may be suitable, he said.
Sometimes the primary site cannot be determined, so genetic analysis of the tumour might be done to see what mutations are driving it and what drugs might target them.
Dr Lodovico Balducci, who specialises in treating cancer in the elderly at the Moffitt Cancer Centre in Tampa, Florida, said age by itself did not preclude successful cancer treatment and much depended on the patient's "biological" age versus his actual years.
"A man 90 years old normally would have a life expectancy of two or three years, but Jimmy Carter is probably much younger than that" in terms of his function," he said.
"If he tolerated liver surgery I imagine he has a relatively good tolerance" to other treatments that might be tried, he added.
Georgia governor Nathan Deal tweeted: "Sandra and I regret to hear that President Carter is facing a serious illness. We'll keep him in our prayers as he undergoes treatment."
Democratic Party of Georgia chairman DuBose Porter said: "Thoughts and prayers are going up for President Carter and his family across the nation. President Carter is tougher than a lighter knot, and we have faith that he will come through this."
Democratic National Committee chairwoman Debbie Wasserman Schultz said: "My thoughts and well wishes are with President Carter, Mrs Carter and their family.
"I wish him strength as he faces this challenge head on, as I am sure he will do with the same spirit with which he has always fought on behalf of others."