Former president Jimmy Carter after teaching Sunday school at the Maranatha Baptist Church near his home in Plains, Ga., on Aug. 30, 2015. (Michael S. Williamson/The Washington Post)

President Trump said Monday that he “has always liked” former president Jimmy Carter, after having repeatedly called him the worst president ever.

Trump’s praise for the 94-year-old Democrat, the longest-living president in U.S. history, came after Carter sent him a “beautiful letter about the current negotiations with China,” the White House said in a statement. The two then spoke by phone Saturday.

“The President has always liked President Carter and First Lady Rosalynn Carter, and extended his best wishes to them on behalf of the American people,” the White House statement reads.

In 2013, Trump ridiculed Carter in a tweet, comparing him to the president at the time, Barack Obama.

“Former President Jimmy Carter is so happy that he is no longer considered the worst President in the history of the United States!” Trump said in the tweet.

Trump made similar comments in interviews in 2014 and 2016. He also ridiculed Carter in a 2014 tweet.

“Of course I don’t think Jimmy Carter is dead-saw him today on T.V. Just being sarcastic, but never thought he was alive as President, stiff!” Trump said.

Carter was the first former president to RSVP for Trump’s 2017 inauguration. But at the same time, he has been critical of Trump’s performance as president, telling The Washington Post last year that Trump was “a disaster.”

“In human rights and taking care of people and treating people equal,” Carter said.

Aaron Blake contributed to this report.