Among the critics who emerged last week to condemn the Philadelphia District Attorney’s Office’s plea deal with an AK-47 gunman who critically injured a man this year during an attempted robbery, one voice stood out for both its prominence and underlying message.

U.S. Attorney William M. McSwain, the top federal law enforcement official in Southeastern Pennsylvania, derided the 3½ -to-10-year sentence for gunman Jovaun Patterson as a “sweetheart deal for a violent defendant."

He went on to deliver a remarkable public rebuke of District Attorney Larry Krasner, accusing his city-level counterpart of “abdicating his responsibility as a prosecutor” and routinely failing to notify or consult crime victims before making plea decisions.

“I think the DA has more and more over the past year shown his true colors,” McSwain said in an interview with the Inquirer and Daily News. “He unfortunately seems wholly unconcerned about providing justice to victims. He seems preoccupied with advocating for defendants.”

A spokesperson for Krasner shot back, dismissing McSwain’s remarks as “political grandstanding and false assertion in the best tradition of the man who appointed [him] — Donald J. Trump.”

With that biting back-and-forth, a simmering tension that had been building behind the scenes between the region’s two top prosecutors burst into public view.

McSwain and Krasner are hardly the first men in their posts to trade public barbs. And turf disputes among local, state, and federal law enforcement agencies aren’t unheard of. But the clash between the U.S. Attorney and District Attorney last week was notable both for its public nature and the rancor behind their remarks.

In some ways, though, the falling out appeared inevitable from the moment both men were sworn in this year.

Both are newcomers to high-profile public offices, ones that occasionally draw a regional if not national media spotlight. Both also hold fundamentally different views on the role a prosecutor should play.

McSwain is a Republican appointee charged with enforcing federal law in the Philadelphia region under one of the most “tough-on-crime” Justice Departments in decades. Krasner is a career defense attorney whose campaign pledges to upend a city criminal justice system he has described as racist, broken, and corrupt have made him a national darling of progressives.

Line prosecutors in each office have cooperated – and continue to do so – on cases where their jurisdictions overlap. In July, federal authorities aided the District Attorney’s Office in an investigation that led to charges against more than 60 alleged members of a Kensington drug ring.

But communication between the men at the top is nearly nonexistent.

Sources from both offices described an initial meeting between Krasner and McSwain last spring as tense. McSwain said last week that although he has regular contact with other district attorneys in the nine-county region covered by his office, he hasn’t spoken to Krasner in months.

“The DA’s Office has decided not to participate in the normal channels of communication,” he said. “Clearly, they’ve got an agenda and don’t really want to spend a lot of time with people who don’t share their views.”

Krasner has described efforts to distance himself from some other prosecutors – including his decision last month to withdraw his office from membership in the Pennsylvania District Attorneys Association — as a principled stance.

In doing so, Krasner said he believed the association was at least partly responsible for an explosion in the state’s prison population over several decades. He also cited the organization’s backing of several ideas that run counter to his reform-driven agenda.

“We have a Pennsylvania District Attorneys Association . . . that would have you believe that the war on drugs all over again is a good idea — for their own incumbency, for their own ambition, for the economies of their own counties,” he said in a speech last month.

In some ways, McSwain and Krasner benefit from having the other as a political foil, said Neil Oxman, a Democratic political consultant from Philadelphia.

The Justice Department under McSwain’s ex-boss, former Attorney General Jeff Sessions, has steered directly into many of the policies that helped Krasner win his election.

“Krasner has received a lot of coverage in terms of the things he’s doing with sentencing reform and other issues,” Oxman said. “He becomes an easy target for someone from the right.”

At the same time, McSwain has made a public point of embracing groups, including police organizations, that have been most alarmed by Krasner’s reform efforts. McSwain’s attendance this month at Pennsylvania Society -- the annual New York City confab of the state’s elected officials, lobbyists, and politicos -- also did not go unnoticed, triggering speculation about his ambitions.

McSwain maintains his criticism of Krasner isn’t based in partisan politics but rather a concern over what he views as the breakdown of the adversarial nature of the legal system in Philadelphia courts.

Krasner spokesman Ben Waxman, meanwhile, rejected the idea that the District Attorney’s Office had somehow become “soft on crime” or an advocate for defendants.

“We are indeed working to reform a broken and unjust system,” he said in a statement. “But we have also continued to prosecute serious violent offenses, including shootings, sexual assaults and homicides.”

He cited dozens of recent cases in which violent criminals — including drug dealers, sex traffickers, and attempted murderers — had been sentenced to lengthy prison terms as a result of his office’s efforts.

The case that ignited last week’s falling-out, involving AK-47 shooter Jovaun Patterson, wasn’t one of them. Even Krasner’s office has described its handling of the matter as a mistake.

Patterson shot and critically injured Michael Poeng, a West Philadelphia beer-deli owner, during an attempted robbery May 5. The incident left Poeng in a coma for weeks and with lasting injuries.

In the deal cemented last month, Patterson agreed to plead guilty to aggravated assault, robbery, and possession of an instrument of a crime in return for a sentence that could set free him on parole in 3½ years. The District Attorney’s Office dismissed the remaining charges, including attempted murder and gun violations that could have significantly increased Patterson’s sentence.

In what appeared to be a violation of state law, Poeng was not notified or consulted about the move by prosecutors. He said he was shocked by the sentence they negotiated for his attacker.

After first defending the plea deal as “wholly appropriate,” Waxman last week blamed an assistant district attorney for the agreement. He said she mistakenly failed to get approval from her supervisor before offering the deal to Patterson.

Krasner’s office sought to reopen the case for resentencing. Common Pleas Court Judge Rayford Means rejected that bid last week, though the judge has scheduled a Feb. 11 court hearing to give Poeng a chance to address the court.

McSwain said his office is weighing whether to file federal charges against Patterson for the same incident — a rare step that requires approval from Justice Department officials in Washington but that could result in a stiffer sentence.

“If there’s going to be justice in this case, it may require federal authorities getting involved,” he said.

Krasner’s spokesperson, meanwhile, dismissed what he described as McSwain’s “fact-free opinion” and stood by his office’s efforts.

“As we have stated, it was an honest mistake by a good lawyer who failed to consult with her supervisor for approval [and] we are trying to correct it,” he said. “We will always attempt to fix errors, regardless if reactionary political opportunists try to use them to score points.”