Once again, President Donald Trump finds himself in trouble after taking political advice from his son-in-law.

Over the last few months, Jared Kushner, who is also a White House senior adviser, was chief among those who lobbied the president to endorse Luther Strange, the losing candidate in Tuesday’s Republican Senate primary in Alabama.

According to two sources who work closely with the young real estate tycoon, Kushner suggested the endorsement, in part, because he believed that a Strange victory would enrage Steve Bannon, the newly reinstalled executive chairman of Breitbart News and a nemesis of Kushner’s from their time together in the Trump White House. Bannon backed the primary winner, Roy Moore, who thinks that homosexuality should be criminalized and suggested this week that parts of the United States are operating under Sharia.

Kushner also thought that getting Trump to support Strange would improve his own tenuous standing with Republican leaders in the Senate, according to several allies of Bannon. “He’s going to need them if things go south in the Russia investigation,” one explained.

The senatorial primary between Strange and Moore was widely viewed as a proxy war between the Republican Party’s establishment forces and its white nationalist fringe. Mitch McConnell (R-Ky.), the Senate majority leader, strongly supported Strange. Bannon, on the other hand, suggested at a rally for Moore on Monday that a “reckoning is coming” not just for McConnell, but for all the “donors” and “corporatists” he believes run the party.

That Trump ultimately supported Strange, tweeting on his behalf and attending a campaign event for him last week, was puzzling to many of the president’s supporters, given his strained relationship with McConnell and his sympathies for Bannon’s populist worldview. Presidents rarely endorse one candidate over another in a primary election. But Kushner was a critical early voice in convincing the president to take a side. McConnell and Rick Dearborn, the White House deputy chief of staff, also were instrumental at various points in the process. Sources close to Bannon noted that Trump first tweeted about Strange on Aug. 8, when Kushner was with the president at his country club in Bedminster, New Jersey.

“No senior adviser to the president in their right mind would ever lead the president to get involved in a primary, let alone a highly contested one that pitted his own base against him,” said Sam Nunberg, a former adviser to Trump ― and a close friend of Bannon’s. “Anyone with a pulse knew that Luther was going to lose the runoff. Luther barely survived the primary.”

The president hadn’t paid attention to the race until recently. According to three sources with direct knowledge, when Moore emerged victorious in the three-candidate first round of voting last month, winning 39 percent, Trump asked confidants: “Who’s he?”

Kushner started advocating for Trump to back Strange after speaking with veteran Republican strategist Jeff Roe. Roe, who is friendly with Kushner, ran Sen. Ted Cruz’s (R-Texas) presidential campaign in 2016 and was hired by Strange earlier this year. Roe sent Kushner emails loaded with polling data that suggested Strange would win easily over Moore and the third candidate in August’s primary election, Rep. Mo Brooks. Kushner forwarded those emails “to appropriate parties,” a White House official said.

Kushner was also alerted to the fact that Brooks had called Trump a “serial adulterer” during the 2016 primary, when Brooks was supporting Cruz. Trump, several sources say, had no idea that Brooks disparaged him until Kushner passed along the news, and it sunk any chances of Trump endorsing him. (The White House official denied this, saying Kushner never spoke about Brooks or the Alabama race to the president.)

Backing Strange, then, seemed like an obvious choice to Kushner. Several sources close to both Moore and Bannon said they believe Kushner wanted to show McConnell that he had real influence with the president ― and that he wanted to show Trump he knew how to win.

“All Jared thinks about is beating Bannon,” said a well-connected friend of the Breitbart chief. “It consumed him before Bannon left the White House, and it consumes him now.” That sentiment was confirmed to me by a source who knows Kushner well and has a more positive view of him. (The White House official dismissed the anti-Bannon notion as “totally untrue.”)

But Kushner misread the mood of Alabama Republicans. Moore won this week’s race by 10 percentage points. And shortly thereafter, ProPublica discovered that Trump had deleted his previous tweets supporting Strange. According to CNN, Trump went to bed on Tuesday night “embarrassed and pissed.”

Breitbart wasted little time in highlighting Kushner’s “awful advice.” An article Wednesday noted that Kushner has a “disturbing pattern” of getting the president in trouble, referencing Kushner’s suggestion that Trump fire former FBI director James Comey. This time, according to Breitbart, Kushner stands accused of dividing Trump from his base. “He has succeeded in doing the only thing that could be fatal to Trump’s presidency and re-election prospects — driven a wedge between the president and his supporters.”

What’s clear, explained someone who has good relations with both Bannon and Kushner, is that the feud between the two of them shows no signs of dying down ― and that Bannon’s side will offer little grace in victory. “Kushner wants to show Trump he is the smarter of the two, but it is not working,” said a friend of Bannon’s.

Two sources confirmed that Trump told confidants Tuesday night that while he is not pleased that Bannon’s candidate won, he is not upset at his former strategic adviser. What he feels about Kushner and his role in the Alabama fiasco is not known.