For Bill McSwain, writing a letter to former President Donald Trump was supposed to help him maneuver toward a run for governor of Pennsylvania.

McSwain, the former U.S. attorney in Philadelphia, wrote to Trump last month claiming he had been blocked from going public about allegations of 2020 election problems in Pennsylvania — handing Trump a new talking point for false claims that the election was stolen as McSwain sought the former president’s endorsement.

But in the 24 hours after Trump blasted out the letter Monday night, McSwain found himself whipsawed between political forces.

His former boss, ex-Attorney General Bill Barr, fiercely disputed McSwain’s claims, saying the letter was intentionally deceptive. He said McSwain admitted to sending it to curry favor with Trump, and wanted to “flap his gums” for the political attention in the contentious days after the election.

Meanwhile, a likely Democratic opponent in the governor’s race, state Attorney General Josh Shapiro, questioned why McSwain hadn’t forwarded any of the supposed fraud allegations — as McSwain wrote that he was ordered to do.

And Republican insiders wondered whether McSwain had delivered a self-inflicted wound before even formally launching his campaign.

“He told me that he had to do this because he was under pressure from Trump and for him to have a viable candidacy he couldn’t have Trump attacking him,” Barr told The Inquirer on Tuesday, recounting a conversation with McSwain.

The former attorney general said he called McSwain on Monday night upset over several claims he made in his letter to Trump, including that Barr had instructed him to pass on investigations of fraud and election irregularities to Shapiro instead of investigating them himself — an assertion Barr flatly rejected. Barr said he had instead given all U.S. attorneys discretion to investigate “specific, credible” allegations, but stopped McSwain from making broad “political statements” about the election.

Barr added that McSwain said he needed Trump’s support, or at least for him stay neutral in the 2022 race, so he wrote a letter that “tried to thread the needle” by laying out “things that were technically true” while not giving “support to Trump’s stolen election narrative.”

“The letter is written in a very deceptive way that is intended to convey an impression, it’s a false one, that he was restrained from looking into election fraud,” Barr said.

McSwain did not respond to interview requests Tuesday, but he told the Washington Post that despite Barr’s denials he stood by what he wrote.

» READ MORE: Bill Barr says Bill McSwain wanted to just ‘flap his gums,’ not investigate 2020 election fraud

McSwain had pitched the idea of holding a news conference last fall, according to two sources familiar with the matter who spoke on condition of anonymity because they weren’t authorized to discuss it. They said McSwain’s plan wasn’t to warn of any specific fraud allegations, but to add his voice to the chorus of GOP complaints about how Pennsylvania was administering the election.

Justice Department officials in Washington turned him down.

“He wanted to not do the business of the department, which is to investigate cases, but instead go out and flap his gums about what he didn’t like about the election overall,” Barr said.

In his June letter to Trump, though, McSwain called the administration of the 2020 election a “partisan disgrace” and wrote that he received “various allegations” of wrongdoing, but was instructed by Barr “not to make any public statements or put out any press releases regarding possible election irregularities.”

McSwain balked at orders to pass serious allegations to Shapiro, a Democrat who had predicted before the election that Trump was likely to lose Pennsylvania.

“I disagreed with that decision, but those were my orders,” McSwain wrote. “As a Marine infantry officer, I was trained to follow the chain of command and to respect the orders of my superiors.”

But while McSwain complained about the directive, his letter made no specific allegations of fraud. He again refused to go into specifics in an interview Tuesday on Talk Radio 1210-WPHT’s conservative Dom Giordano Show.

“I’m not making any judgments about what I would or would not have found,” he said. “But what I didn’t like was that I wasn’t free to follow the evidence wherever it leads.”

He also complained that Barr’s guidance prevented him from publicly discussing his concerns with how the election in Philadelphia was run — echoing a series of criticisms that Trump and his allies have repeatedly lodged against the city and the state.

“I thought I could have had some influence on election officials, if I’d been more vocal,” McSwain said.

» READ MORE: Supporting Trump’s election lies is becoming a litmus test for Pennsylvania Republicans seeking higher office

Justice Department policy largely prohibits officials from discussing ongoing investigations — especially political probes where early reports of un-vetted allegations might influence the outcome of elections.

Trump and his campaign litigated Pennsylvania’s election administration issues in state and federal courts after the election. They failed to present any concrete evidence to back up their claims and lost every major challenge.

Shapiro’s office said that if McSwain had any specific concerns about the election integrity in Philadelphia, his letter to Trump “is the first our office has heard” about them.

“We received and sent multiple referrals to local, state and federal law enforcement, but received no direct referrals from Mr. McSwain’s office,” Shapiro spokesperson Jacklin Rhoads said. “This personal note to President Trump, sent seven months after the election, is the first our office has heard of Mr. McSwain’s concerns. If he was aware of allegations of voter fraud, Mr. McSwain had a duty to report and, as he knows, our office investigates every referral and credible allegation it receives.”

A spokesperson for the U.S. Attorney’s Office McSwain once led said in a statement Tuesday that the office always “evaluates information about criminal conduct in a fair and impartial manner in every instance.”

» READ MORE: Fact-checking false claims about Pennsylvania’s presidential election by Trump and his allies

The backlash served as a harsh introduction to the political spotlight for McSwain. He has never run for public office, having mostly spent his career at private law firms and most recently as a prosecutor in control of information that becomes public.

Some Republicans said McSwain had delicately walked a tightrope — arguing that his complaints about procedures could appeal to Trump and his supporters without fully wrapping him in false election claims. A battle with Barr — who has gone from backing some of Trump’s claims before the election to rejecting them after — might not necessarily hurt him with GOP voters.

But other party insiders were scratching their heads.

Until this week McSwain had often appeared to be a reluctant player in Trump’s long-running efforts to undermine the election. He has dodged previous questions about accepting the results, and some Republicans envisioned the Marine veteran and prosecutor from Chester County as the kind of candidate who could regain GOP support in the populous suburbs.

But with the letter garnering national headlines before he even formally enters the race, McSwain might have tied himself to the kind of lies and drama that has turned off many traditional GOP voters.

» READ MORE: Pennsylvania Republicans have a path to victory in 2022. Pro-Trump candidates may not follow it.

The back-and-forth landed as two other GOP hopefuls, State Sen. Doug Mastriano and former U.S. Rep. Lou Barletta, have vocally led calls for another review of Pennsylvania’s 2020 election results. Each is playing to Trump’s claims as they openly seek his support, and as his election lies have become a defining feature of GOP primary campaigns.

”It’s kind of a double-edged sword,” said one longtime Pennsylvania Republican operative, who spoke on condition of anonymity to candidly discuss the party’s gubernatorial race. “As long as Trump remains on the stage, it’s a tough spot for these guys.”

It may get even tougher now that Barr has accused McSwain of several instances of purposeful deception.

He pointed, for example, to a mention McSwain made to a specific “directive” to share a “serious allegation” with Shapiro. That order came not from Barr but a former top aide of his, Richard Donoghue, about rumors in Delaware County of the alleged loss of 47 thumb drives used in voting machines.

Barr said Donoghue’s direction to share the information with Shapiro was not an order to “stand down” any fraud investigation. He noted that state and federal agencies often pursue similar allegations, sometimes in a coordinated approach.

A senior prosecutor in the Delaware County District Attorney’s Office said Tuesday that no member of McSwain’s office had contacted them about those allegations.

» READ MORE: A timeline of how Trump and his allies tried to overturn Pennsylvania’s election results

Another sign of deception: Barr said that McSwain was, in fact, conducting investigations and that he spoke with the prosecutor about making sure he had the FBI resources he needed.

“He was in the thick of investigating stuff with me prodding him along,” Barr said.

No credible evidence has surfaced of any significant fraud in Pennsylvania’s election results.

Trump, though, has used McSwain’s letter to continue his ongoing crusade against the lawful results. He mentioned McSwain in a July 3 speech in Florida, declaring, “We have a U.S. attorney in Philadelphia that says he wasn’t allowed to go and check Philadelphia.”

Trump promised to reveal at some point who allegedly held back McSwain.

He went further Sunday at the Conservative Political Action Conference in Texas, disclosing the existence of McSwain’s letter but saying he didn’t want to be the one to release it. Trump told the crowd McSwain “was not allowed to do his job.”

Staff writer Vinny Vella contributed to this article.