Among the deaths at police officers’ hands that animated the Black Lives Matter movement in its early stages, Gray’s was uniquely ambiguous. He was not shot, as were Laquan McDonald in Chicago, Michael Brown in Ferguson, Mo., Tamir Rice in Cleveland and Walter Scott in North Charleston, S.C. All that is known for certain is this: When he encountered the police officers, Gray — who had engaged in low-level dealing over the years — ran. When the police gave chase and tackled him, they found a small knife in his pocket and placed him under arrest. Gray was put in the back of a police van shackled and unbuckled, in violation of a new department policy. When the van arrived at the Western District’s headquarters, Gray was unconscious with a nearly severed spinal cord. He died seven days later.

Protesters took to the streets after Gray’s death. Batts, who had canceled a European vacation he was scheduled to take the previous week, appealed to Hogan’s new state police chief for reinforcements, but he received an offer of only about 120 officers, far fewer than he hoped for. The demonstrations proceeded mostly peacefully for a week until Saturday, April 25, when rowdy baseball fans headed to Camden Yards — including out-of-town Red Sox fans — taunted a group of protesters who had marched into downtown. In the mayhem that ensued, some teenagers and young men smashed in police cruisers’ windshields and bar windows and looted a 7-Eleven.

The police held back, making only about a dozen arrests. It appeared as if Batts wanted to set himself apart from the heavy-handed tactics in Ferguson, where anti-riot police officers bristled with military hardware. That night, Batts, who declined to be interviewed on the record for this article, hailed his officers’ limited response to the disorderly crowd amassed downtown. “We’re taking our time to give them the opportunity to leave,” he told reporters.

Bealefeld, Batts’s predecessor, told me: “There were people inside police leadership circles that were being celebrated for their restraint. People were thinking, ‘Aha, we want to be seen in that light.’ ” But this hands-off response drew resentment within the department, where many were already disgruntled with the commissioner from California. “It would have been over that night if we’d been able to do our jobs,” one veteran officer who attended a command briefing that weekend told me, speaking on the condition of anonymity because he was not authorized to talk to reporters. “They let it fester.”

The approach was notably different two days later, the day of Gray’s funeral. The police were on edge over two separate rumors — a social-media call for a youth “purge,” or rampage, into downtown after school let out, and talk of gangs uniting to attack police officers. The F.B.I. quickly determined that the second threat was baseless, but Batts responded heavily to the first rumor, sending 300 officers to confront students at a big west-side transit hub after school and stand guard outside the adjacent shopping mall. Someone in authority — to this day, officials won’t say who — ordered a shutdown of transit service. Some of the stranded teenagers started throwing rocks and bricks at the police, who lacked proper protective gear and had received little riot-response training. Before long, a CVS pharmacy a mile away was on fire.

In hindsight, it’s hard to avoid the conclusion that the riot was probably avoidable — if Batts had had more officers at his disposal, if his officers had been better trained, if there hadn’t been the seeming overreaction to Monday’s swirling rumors. But within three hours it was out of his control. Governor Hogan dispatched National Guard troops and established a command center in West Baltimore. That Friday, Mosby — whose policing request may very well have led to Gray’s arrest — held a televised news conference announcing a long list of serious charges against six officers, including “depraved heart murder,” or causing death through indifference. “I have heard your call for ‘no justice, no peace,’ ” she declared.

Her announcement of charges — based on an investigation her own office conducted, not trusting the department’s — helped stanch further unrest, but it delivered a profound blow to morale among rank-and-file officers, who were already aggrieved over their leadership’s handling of the riot, in which 130 officers were injured. Officers bridled at the ringing, declamatory tone of her announcement. “It was the way she did it — the grandstanding,” the veteran officer told me.