President Trump and Senate Majority Leader Mitch McConnell sought to project unity Monday amid continuing tensions that threaten to complicate the Republican Party’s fall agenda and midterm elections strategy.

But by the end of their ­40-minute joint news conference in the White House Rose Garden, they had not resolved the most combustible component of their fragile alliance: Stephen K. Bannon.

In one breath, Trump praised his former White House chief strategist, who is determined to wage “war” against the majority leader and GOP senators up for reelection in next year’s midterms. In another, he signaled that he might persuade him to back down.

“I like Steve a lot. Steve is doing what Steve thinks is the right thing,” Trump said while standing next to McConnell (R-Ky.). “Some of the people that he may be looking at, I’m going to see if we talk him out of that, because, frankly, they’re great people.”

The confusing appraisal of Bannon and his controversial tactics raised new questions about the road ahead for Trump and McConnell — including how long their detente can last.

After a working lunch, the two leaders tried to dismiss signs of a troubled relationship and demonstrate that they are on the same page when it comes to the GOP’s biggest legislative undertaking of the fall: an effort to rewrite the nation’s tax laws.

“We are probably now, despite what we read, we’re probably now — I think, at least as far as I’m concerned — closer than ever before,” Trump said. “And the relationship is very good.”

But the question of where Trump stands in the increasingly hostile feud between Bannon and Senate Republicans highlighted the potential tensions ahead.

Since leaving the White House in August, Bannon has dedicated himself to attacking McConnell and other members of the GOP establishment, who he argues are standing in the way of Trump achieving the nationalist agenda that swept him into the White House. Bannon is promising to find primary opponents for all but one of the Senate Republicans running for reelection next year with the stated goal of ousting McConnell from leadership.

McConnell sidestepped a question of whether he and Trump discussed Bannon’s role in the midterm elections during their lunch, saying his goal is to support incumbents and maintain Republican control of the Senate.

“The way you do that is not complicated,” he said. You have to “nominate people who can actually win, because winners make policy and losers go home.”

Bannon’s effort to unseat Republican senators loyal to the majority leader met its first test in September’s Alabama Republican primary when he supported controversial former judge Roy Moore over Sen. Luther Strange. Strange, who lost, was backed by McConnell and Trump.

Trump said he plans to meet next week with Moore, who has been a fierce McConnell critic. Moore did not meet with the Senate leader this month during a brief trip to Washington. He did not meet with Trump, either.

The rare joint question-and-answer session highlighted the stylistic differences between Trump and McConnell that have come into focus this year. It was an unusual setting for the studiously on-message Senate leader, who prefers short answers and brief exchanges with reporters. Trump, on the other hand, appeared to relish the chance to field question after question from reporters who shouted over one another.

With McConnell standing mostly silent by his side, Trump eagerly fielded a volley of questions about Puerto Rico, protests by National Football League players during the national anthem, Hillary Clinton and special prosecutor Robert S. Mueller III’s investigation into Russian election meddling — at times overshadowing the effort to display a message of unity that kicked off their appearance.

Trump and McConnell emphasized that their top priority is passing tax cuts by the end of this year, although they left open the possibility that that might not happen. They also commended each other for their efforts to shape the federal bench by nominating and confirming conservative judges.

“We have the same agenda,” the majority leader said.

Still, there were surprises. The president said he plans to release an “economic development bill” but that he had not briefed the Senate leader on it.

Many Republicans view tax overhaul as do-or-die effort, politically. They argue that it is the last realistic chance to demonstrate to the conservative base that Republicans can notch a large-scale achievement after being handed complete control of the federal government.

But their effort faces tall hurdles, not the least of which is the friction between Trump and Republican senators, whose votes the president will need to pass a tax bill. Earlier in the day, those tensions were on display at a Cabinet meeting in which the president empathized with Bannon and blamed Senate Republicans for the GOP’s legislative woes, including the failure to repeal and replace the Affordable Care Act.

“We’re not getting the job done,” Trump said. “And I’m not going to blame myself, I’m going to be honest. They are not getting the job done.”

The president singled out Sen. John McCain (R-Ariz.), who cast a decisive vote in the summer against a GOP plan to repeal and replace the ACA.

He quickly added, “I can understand where Steve Bannon is coming from.”

"You had a few people that really disappointed us. They really, really disappointed us," he said. "So I can understand fully how Steve Bannon feels. Okay?"

After Senate Republicans failed to dismantle the ACA, the relationship between Trump and McConnell worsened. The president took to blaming the majority leader publicly for the failure.

"I'm very disappointed in Mitch," Trump said in August. On Twitter, he aggressively urged McConnell to "get back to work."

For the most part, McConnell has declined to publicly escalate that war of words, preferring instead to sidestep the attacks. But McConnell’s allies have grown increasingly concerned with the level of criticism the president and his associates are directing at the Senate leader and other rank-and-file GOP lawmakers.

Trump’s recent feud with Sen. Bob Corker (R-Tenn.), the chairman of the Foreign Relations Committee, has further rattled his relationship with Capitol Hill Republicans. Corker is seen as a key vote on budget and tax issues and a leading voice on foreign affairs.

Trump is making some efforts to mend fences with Republican senators with whom he has clashed in the past. He has played golf recently with Sens. Lindsey O. Graham (S.C.) and Rand Paul (Ky.), who have criticized him sharply.

On Monday, he mixed praise with criticism.

“I know the Republican senators,” Trump said at his Cabinet meeting. “Most of them are really, really great people that want to work hard and they want to do a great thing for the American public.”

He added, “You had a few people that really disappointed us.”