“When you look at some of the audiences cheering for Republicans sometimes, you look out there and you say, ‘Those are the spasms of a dying party,’ ” Sen. Jeff Flake (R-Ariz.) said on ABC’s “This Week.” (Andrew Harnik/AP)

Republicans could easily lose their congressional majorities in 2018, two retiring GOP lawmakers warned Sunday, pointing to a lack of diversity in the party and President Trump’s pattern of catering to his narrow conservative base as likely harbingers of bad news for their party.

“When you look at some of the audiences cheering for Republicans sometimes, you look out there and you say, ‘Those are the spasms of a dying party,’ ” Sen. Jeff Flake (R-Ariz.) said on ABC’s “This Week.” “By and large, we’re appealing to older white men, and there are just a limited number of them.”

“Clearly the Republican Party, my party, is going to experience losses. It remains to be seen whether we’ll lose the majority,” Rep. Charlie Dent (Pa.) said, appearing on the same program. “I tell my colleagues, look, we’re going to be running into a head wind, you’ve got to be prepared for the worst. . . . It’s going to be a very tough year.”

Flake and Dent are frequent critics of the president and his advisers, particularly former chief political strategist Stephen K. Bannon, who has promoted what Flake termed "ultranationalist, ethnonationalist, protectionist" politics in the GOP. Yet their criticism is taking on new significance in the wake of Democrat Doug Jones's U.S. Senate victory in Alabama this month — a loss that many blame on Bannon and his allies insisting that the GOP base would secure a win for conservative Roy Moore in the deep-red state, despite allegations against him of sexual misconduct with teenage girls while he was in his 30s.

Since that loss, GOP leaders who in the past refrained from directly criticizing Bannon’s politics have challenged him head-on.

Can Democrats win back the House in 2018? It’ll be tough.

“Let me just say this: The political genius on display of throwing away a seat in the reddest state in America is hard to ignore,” Senate Majority Leader Mitch McConnell (R-Ky.) told reporters on Friday when asked whether he blamed Bannon for the loss.

Despite McConnell’s criticism, it is not clear that Trump will pivot the GOP away from Bannon’s brand of political strategy.

Trump finished off last week by signing a sweeping tax bill into law, the first significant legislative achievement of his presidency. But he interrupted his own victory lap over the weekend with tweets disparaging FBI Deputy Director Andrew McCabe, after reports that McCabe would be retiring in the new year, while the White House scrambled to disavow a report in the New York Times that Trump had used racially charged language to describe Haitians, Nigerians and other ethnic groups in closed-door discussions about his immigration policies.

In an interview on “Fox News Sunday,” Marc Short, the White House director of legislative affairs, defended Trump’s tweets about McCabe and said the White House would “wish him well” as he retired next year.

Trump, who is vacationing at his Mar-a-Lago resort in Florida, also took to Twitter on Sunday to address the weekend’s news, touting the very thing that lawmakers like Flake and Dent have cautioned against relying on: his base.

"The Fake News refuses to talk about how Big and how Strong our BASE is," Trump tweeted.

In their interviews, which were taped before Sunday, Flake and Dent had words of caution for the president: If you cater only to your base, other voters will look for an alternative.

“If we continue to go down that path, just to drill down on the base, then I think you have a lot of people realize there’s no future for them in this party,” Flake said. “I do worry that in the future we’ll be faced with President Trump running for reelection on one side, drilling down hard on a diminishing base, and on the other side you might have somebody like [Sen.] Bernie Sanders . . . that leaves a huge swath of voters in the middle that may be looking for something else.”

Flake said that if Trump finishes his term and seeks reelection, he will face an independent challenger in 2020, if not also a Republican challenger. The senator did not rule out running himself in 2020, though he added, “That’s not in my plans.”

Sanders, appearing Sunday on CNN’s “State of the Union,” did not speculate as far out as 2020. But he pointed to recent Democratic victories in statewide elections in Alabama, Virginia and New Jersey as being “a referendum on Donald Trump.”

“If I were the Republicans, I’d be worried very much about 2018,” the independent senator from Vermont said.

Democrats need to gain two seats to claim the majority in the Senate and about two dozen to flip the balance of power in the House. The looming midterm elections are, thus, likely to cast a pall over the legislative agenda in 2018, as Republicans look for areas in which they can secure much-needed Senate Democratic cooperation to rack up more legislative accomplishments, while Democrats weigh what ventures are worth a compromise just months before a critical election cycle.

Policy challenges such as welfare reform and a solution to keep hundreds of thousands of young undocumented immigrants from deportation — as the Deferred Action for Childhood Arrivals, or DACA, program expires — are likely to end up in bitter partisan fights, while Sanders said that "we can make some progress" on infrastructure if Trump approaches the Democrats in good faith.

But the Republicans appearing on talk shows Sunday suggested that as long as Trump is in the Oval Office, it will be difficult to work across the aisle if doing so means crossing him.

“Before Donald Trump became president, the litmus test, it was really about the ideological purity and conformity” with Republican ideas, Dent said. “Now the litmus test has changed: It’s loyalty to the man.”

“If I set myself on fire for them, they would complain that the temperature of the flame isn’t hot enough,” the GOP lawmaker said, explaining how Trump was “a factor” in his decision to retire after his term ends next year. “It’s not about ideology anymore, it’s about loyalty to the president.”

David Weigel contributed to this report.