Joe Biden once praised the segregationist Republican Sen. Strom Thurmond of South Carolina as “one of my closest friends” and championed him as someone who believed in America's diversity.

He was giving a speech at the Strom Thurmond Institute in South Carolina in December 1988. Thurmond, Biden said, had urged him to keep running for president, telling him: "You’ve got a good 30 years left to try." A year earlier, Biden had dropped out of the presidential race amid plagiarism accusations. He ran again in 2008, dropping out early a second time, and now, 31 years after the speech, he is having a third tilt at the White House.

Previously unaired video of the speech has been obtained by the Washington Examiner. Biden, then 46, was serving in the Senate at the time and had recently dropped out of the 1988 presidential race amid plagiarism accusations. He accepted an invitation from the Strom Thurmond Institute at Clemson University to speak about foreign policy to high school and college students.

Biden began his remarks by describing the close relationship he developed with Thurmond after joining the Senate in 1973.

[Related: Joe Biden embraced segregation in 1975, claiming it was a matter of 'black pride']

Thurmond, a Southern Democrat-turned-Republican, ran for president in 1948 on a segregationist platform and led a record-setting filibuster to block the Civil Rights Act in 1957. He later softened his stance on civil rights issues in the 1980s but never fully renounced his position on segregation or the racially inflammatory comments he made during his presidential campaign.

In 2002, Sen. Trent Lott of Mississippi, a Republican, was forced to step down as Senate majority leader after he said at Thurmond's 100th birthday party that America "wouldn't have had all these problems over all these years" if Thurmond had won the White House.

Thurmond was also one of the major opponents of mandatory busing to desegregate schools in the 1970s and 1980s, a position Biden also held.

“I came to the United States Senate. I was a 29-year-old fellow out of the Civil Rights movement, a public defender, and it turns out one of my closest friends ends up being Strom Thurmond, a man whose background and interests, at the time I came, were considerably different than mine,” Biden said in his 1988 speech.

“If you had told me when I entered the United States Senate that one of the people that I’d have the closest relationship with in the Senate would be Strom Thurmond, I would have told you that you were crazy. And I suspect maybe Strom would have told you, you were crazy,” he added. “I’m not just saying Strom and I are close. Anyone who knows the Senate knows how seldom we agree on the controversial issues but how closely we work together.”

Biden said the Washington press would refer to him and Thurmond as the "marvelous marriage" and "the odd couple" and would often ask them how they got along.

[Also read: McCain family to support Biden in 2020 race in bid to defeat Trump]

“I get along with Strom Thurmond because I respect him,” he said. “Because Strom Thurmond believes deeply in what he does, and he is a consummate legislator. He understands that this country is made up of 240 million people, the most heterogenous, diverse society in the world, and every point of view has to be accommodated. Every point of view has to be listened to. And every point of view has to have its day. Its day in court, its day in the Senate, its day in the House, its day in the administration. And that’s how he operates.”

Biden said he even got Thurmond’s blessing on his 1988 presidential campaign. After Biden dropped out, Thurmond told him he still had three decades to try again.

“Strom told me, he said, ‘Joe, if there has to be a Democrat as president, I hope it won’t happen,’ he said, ‘It might as well be you.’ And after I dropped out of the race, he came and said, ‘Don’t worry about it.’ He said, ‘You’ve got a good 30 years left to try,’” said Biden, adding that “not all of us are Strom Thurmonds.”

The then-Senator also joked that Thurmond had advised him to “have more children” for the sake of his health. “We are negotiating that at this moment with my wife,” said Biden.

Thurmond, who was 86 when Biden gave his 1988 speech, had four children after the age of 68. After his death, it was revealed that he also had another daughter with a black household maid who he never publicly acknowledged during his life but privately supported financially.

Biden was criticized for his eulogy at Thurmond’s funeral in 2003, when he called him a "brave man, who in the end made his choice and moved to the good side." Biden said: "I disagreed deeply with Strom on the issue of civil rights and on many other issues, but I watched him change. We became good friends."