Sen. Jeff Flake (R-AZ) paid tribute on Sunday to his longtime friend, John McCain, who died on Saturday after a battle with brain cancer, making sure to highlight the key role McCain played in a divided Republican party in the Trump era.

Flake, who alongside McCain has been one of President Donald Trump’s toughest GOP critics, said McCain’s voice was a critical one throughout the first 19 months of the Trump presidency in order to draw a stark contrast between their governing philosophies.

“His voice was important—has been for years, but never more important than the past year,” Flake, who visited McCain the day before he died, said on CNN’s State of the Union.

“And that’s one thing that I expressed to the family, the gratitude of all of us that they took such good care of John and made sure that he was able to speak in these last few months when it was so important,” he said. “It’s tough to have a voice like that silenced.”

Indeed, even as McCain remained home in Arizona while undergoing medical treatment, he remained vocal about the news of the day. He urged his colleagues to reject Gina Haspel’s nomination to lead the Central Intelligence Agency; he criticized Trump for his deference to Russian President Vladimir Putin after their summit in Helsinki; and he accused Trump of “making unnecessary and unreciprocated concessions” to North Korean leader Kim Jong Un.

“We’ve certainly needed John McCain’s voice over the past year. And despite the circumstances, we’ve had it,” Flake said. “And I think that we could do with this kind of approach to politics, and we’d do well to remember John McCain and his legacy as we go forward. I know that that’s what he would like.”

During the 2016 presidential election, Trump mocked McCain’s military service, saying the senator was “not a war hero” because he was captured and held as a prisoner of war in Vietnam. McCain reportedly did not invite the president to his funeral, and asked that former Presidents George W. Bush and Barack Obama speak at his service.

McCain was 81. He will lie in state at the Arizona state capitol on Wednesday. His memorial service will be held on Thursday at the North Phoenix Baptist Church. Later that day, he will be flown from Phoenix to Joint Base Andrews outside Washington. On Friday, he will lie in state in the U.S. Capitol Rotunda. McCain’s life will be honored at a national memorial service at Washington National Cathedral on Saturday. On Sunday, he will be buried at the U.S. Naval Academy Cemetery in Annapolis, Maryland.