This week, Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff, is being portrayed either as the savior of the Republic or as guilty of betraying it to our greatest adversary, based on two phone calls he made to a Chinese general. In truth, he is neither. But the story does show how broken our government and politics were at the end of the Trump administration, and how that spilled over into our foreign policy — with consequences that are still reverberating.

According to the book “Peril” by Bob Woodward and Robert Costa, Milley made two “secret” phone calls to Chinese Gen. Li Zuocheng on Oct. 30, 2020, and on Jan. 8. The book, due out next week, reports these calls were sparked by Milley’s concern that President Donald Trump might start a war with China during his final months in office. Milley’s allegedly treasonous quote to Li, as reported in the book, was, “General Li, you and I have known each other for now five years. If we’re going to attack, I’m going to call you ahead of time. It’s not going to be a surprise.”

In a statement Wednesday, Milley’s spokesman defended the calls and said they were cleared through Defense Department leadership and briefed to other agencies afterward. In other words, they weren’t secret at all. Pentagon officials told reporters this week Milley’s calls have been “grossly mischaracterized.” Woodward and Costa are standing by their reporting.

According to several senior Trump administration officials I spoke with this week, the truth is more complicated than either Milley’s attackers or defenders admit. First of all, Milley was not freelancing — for the simple reason that the calls were not his idea. Then-Defense Secretary Mark T. Esper made the decision in mid-October 2020 to send a reassuring message to the Chinese military because of intelligence that China’s leadership was concerned about increased U.S. military activity in the South China Sea.

“Milley was absolutely not going rogue,” a senior Trump Pentagon official told me. “Esper took the initiative on this in October. Esper asked his own policy folks to backchannel the message. Milley’s message followed Esper’s.”

To be clear, Esper’s message to other countries — conveyed by his own policy staff — was one of general reassurance and keeping lines of communication open. It did not include specifics such as the ones reported in Woodward and Costa’s book about a purported Milley promise to warn China before any attack. Esper also decided, on his own authority, to delay the deployment of U.S. Navy assets to the region for an upcoming military exercise — another effort to cool tensions.

Several Trump White House officials told me they were not informed about Esper’s and Milley’s calls to Chinese military officials. Trump has also said that he didn’t know and was never planning to attack China. In those final months, Trump’s National Security Council was coordinating many various China-related activities, including rolling out new sanctions and delivering tough speeches about the Chinese Communist Party. But Esper and Milley weren’t a part of most of that.

“[The Defense Department] was not clued in on some of the key things we were doing on China, so DOD was not in a position to make those decisions without consulting us,” a senior Trump White House official told me.

Communication between the White House and the Pentagon broke down in those final months, a result of mutual distrust following the fallout over June events in Lafayette Square. Esper and Milley had the authority to do what they did. But the White House concern was that they were undermining the White House China team’s messaging and actions vis-a-vis Beijing.

It’s not even clear Beijing really believed Trump was planning an attack. China might have been messaging that concern to test whether the United States would react, which Esper did.

“The risk is [Milley] could have caused the Chinese to miscalculate and take some sort of diplomatic, economic or military action with far-ranging consequences, because he was giving the wrong signal,” another senior Trump administration official said.

Milley’s defenders point to Trump’s erratic behavior as a legitimate cause for the chairman to worry that Trump might attack China. But when he allegedly made those comments to Li in October, there was no actual evidence Trump was planning anything of the sort. Even after the Jan. 6 Capitol riot, Trump didn’t do anything to specifically suggest he intended to launch nuclear weapons.

When proper context is added to the Milley calls, the picture that emerges is not of a brave military officer saving the country from a crazy president hellbent on starting World War III. It’s a more mundane, but all-too-common Washington story of several powerful men with big egos who can’t get along, causing government dysfunction and diplomatic confusion. The episode also illustrates how deeply U.S. foreign policy nowadays is falling victim to our hyperpolarized domestic politics.

The legitimate criticism of Milley is not that he betrayed the country to China. Milley’s failing was that he believed, according to this and many other recent books, that it was his job to save the Republic from the president. Milley’s offense was not treason, it was hubris.