Paul D. Ryan has one big regret about American politics.

“The thing that bothers me most in politics today is identity politics,” the House speaker said Wednesday, a few hours after announcing his plan to retire at the end of his term.

Ryan (R-Wis.) defined that as politicians “playing to people’s divisions and exploiting people’s frustrations,” something he felt that liberals have long done. “The left was really good at it; now the right does it,” Ryan said in an interview.

A couple of hours later, Ryan drove down Pennsylvania Avenue to have dinner at the White House with President Trump. He planned to bring a checklist of five or six legislative agenda items to discuss with Trump.

That has been the inherent contradiction of Ryan’s position in Washington. He’s someone who at 3:30 p.m. name-checked himself as a “Jack Kemp guy” who “believes strongly in inclusive, aspirational politics” and by sunset broke bread with a president who mastered the art of grievance politics all the way into the Oval Office.

Trump’s personal character traits of bravado and confidence, denigrating some people while championing others, have run counter to what Ryan has stood for in his 20-year career in Congress.

From opposite ends on the spectrum of political tenor, their once rocky relationship has mostly stabilized. Gone are the rebukes Ryan used to deliver when Trump attacked his enemies. Now, Ryan uses private discussions to dissuade Trump from some of his most bellicose actions.

“It works better to have private conversations than public disputes,” Ryan said in a 30-minute interview with several media outlets, suggesting Trump “appreciates” it when the criticism is not aired in public. “I can say anything. We have very candid conversations.”

To some Democrats, this is Ryan’s biggest outrage. Rep. Adam B. Schiff (D-Calif.) said he likes Ryan personally and knows that he is smart — which is why Schiff, ranking Democrat on the House Intelligence Committee, wants Ryan to denounce Trump for “tearing down” the Justice Department, the free press and the judiciary.

“I wish he were speaking out instead of leaving. And I think that he will have to answer for that as part of his legacy,” said Schiff, who opposed Ryan’s decisions to support Republicans on the Intelligence Committee during their investigation of Russian interference in the 2016 election.

During that campaign, Ryan established himself as something akin to a Republican referee, wading into the contest to criticize candidates who were out of line. That meant he criticized Trump. For pushing a travel ban on Muslims. For the “textbook definition” of racism by attacking a judge’s ethnicity. For not denouncing the campaign support from white supremacists.

Ryan even withheld his endorsement for several weeks after Trump locked up the Republican nomination in May 2016. After the revelations by The Washington Post of a 2005 audio recording of Trump boasting about grabbing women’s genitals, Ryan refused to campaign with Trump.

Trump won anyway, and Ryan had a decision to make. He decided to work with Trump on key policy items, particularly health care and taxes.

“I looked at it as a huge opportunity,” Ryan recalled. Shortly after the election, he met with Trump and Vice President Pence, putting together a “Gantt chart,” a workflow system that is common in construction, because Ryan figured the real estate mogul would understand that code.

“I believed there was a chance of unifying to pass an agenda to make a positive difference,” the speaker said. At that meeting, he laid out the timeline for trying to repeal the Affordable Care Act, for passing a massive tax cut and approving deregulation. “Add infrastructure,” Trump told Ryan, “and I’m in.”

It was only the second or third time that Ryan and Trump had really met in person. “Then we just got to know each other. I didn’t know the guy. You know, I knew what I saw on TV,” he said.

Democrats accuse Ryan of essentially sublimating his core principles on issues such as diversity and rule of law to get his preferred economic agenda signed into law. “He has a seat at the table, and I think it is expected of the speaker to voice dissent to the president when he disagrees,” said Rep. G.K. Butterfield (D-N.C.), a former chairman of the Congressional Black Caucus.

How can Ryan reconcile his own support for Kemp-style optimism with a president who equivocated on race riots in Charlottesville fueled by white supremacists?

“Look, he won the election. He’s the president of the United States,” Ryan said. “We’re making really good progress on a lot of signature issues, and we’re making a positive difference in people’s lives.”

Without addressing Trump’s actions, Ryan said that the Republican agenda of cutting taxes would “deny the oxygen of identity politics” through higher wages and upward mobility for the working class and poor.

“Those are some of the best tools to fight the seed corn of identity politics,” he said.

Democrats believe that without public denunciations of Trump’s behavior, that only enables him to take more dramatic actions, most recently being the president’s public consideration of firing special counsel Robert S. Mueller III or other Justice Department officials.

“I’m not interested in people’s private misgivings. They need to speak out now, the country needs them to speak out now and not in hushed tones,” Schiff said.

Only a small group of advisers and family knew Ryan’s decision was coming this week, a final call made at home Sunday during a family dinner in Janesville. On Wednesday morning, Ryan made sure to call Trump so he could tell him of his decision before the news broke — a phone call that might have seemed improbable two years ago.

“He was supportive, he was disappointed. But he was very gracious; he was extremely gracious,” Ryan said.