(CNN) — Sen. Lindsey Graham said Wednesday that President Donald Trump called him after he delivered an emotional farewell to Sen. John McCain on the Senate floor, telling the South Carolina Republican he “did right by his friend.”

“He called yesterday after my speech and he couldn’t have been nicer. He said, ‘That was very sad. I just want to let you know you did right by your friend.’ I said, Thank you Mr. President.'” Graham told CNN’s Dana Bash in an interview on “Inside Politics” Wednesday, adding that the call from the President was “right out of the blue.”

READ MORE: Blackhawks GM Stan Bowman Has 'Stepped Aside' Following Independent Probe Into 2010 Sexual Assault Claim Against Former Coach

Never one to mince words, Graham admitted when Trump “says something bad about John, it pisses me off.”

Asked by Bash how he squares his close friendship with McCain to his new relationship with Trump, Graham said, “If you know anything about me, I want to be relevant. I want to make sure that this President, Donald Trump, who I didn’t vote for, ran against, is successful.”

He added, “To those who want me to say the only way you can honor John McCain is to fight Donald Trump and try to kick him out of office, I don’t agree. I’m going to do what I think is best for the country using what John taught me about the country.”

During the 2016 campaign, Trump attacked McCain’s record of service, saying the Vietnam veteran was “not a war hero” because he was captured.

Trump also blasted McCain for his deciding “no” vote on Republicans’ efforts to partially repeal Obamacare last year.

READ MORE: Illinois Senate Passes Legislation That Would Repeal Parental Notification Requirement For Minors Seeking Abortions

McCain criticized Trump’s policies and politics.

He called Trump’s Helsinki news conference with Vladimir Putin “one of the most disgraceful performances by an American president in memory.”

McCain also made clear he did not want Trump to attend his funeral service.

“I regret the relationship between the two,” Graham said of the Arizona senator and President. “John is my dearest friend in the world and I’m going to try and help President Trump.”

Besides his tribute speech on the Senate floor, Graham will read scripture at McCain’s memorial service at the National Cathedral in Washington, DC, on Saturday, and give a tribute in Annapolis, Maryland, at the Naval Academy service on Sunday.

MORE NEWS: Chicago Weather: Wednesday Starts On A Chilly Note

© 2018 Cable News Network, Inc., a Time Warner Company. All rights reserved