SOMERVILLE, Tex. — Joshua Aaron Hall had been a resident of the Burleson County Jail for about a week when he requested a meeting with Gene Hermes, the sheriff’s investigator who had locked him up for violating probation. The stocky lawman arrived in the featureless interview room on the morning of Dec. 13, 2013, placed his soda cup on the table and apologized for not getting there sooner. He asked in his gravelly drawl if they would be talking about Mr. Hall’s own case.

“No,” said Mr. Hall, a methamphetamine user and petty criminal who was facing his most serious jail time. “I want to give you something else.”

Mr. Hall reminded the investigator that they had spoken previously about the narcotics trade in the vast flatlands of central Texas. “Gene, you said you wanted to eradicate the problem,” Mr. Hall said. “And I’ve been thinking for the past couple of days that, you know, maybe I’m put in this position to help you do this.”

“All right,” the investigator said.

“I know of an illegal grow operation,” Mr. Hall volunteered.

Investigator Hermes nodded. “Big grow, small grow?”

“It’s kind of small,” Mr. Hall said, before catching himself. “But that ain’t the point. It’s illegal. Weapons are involved.”

The scruffy informant, outfitted in black-and-white stripes, told the investigator that he had a friend named Henry Magee who lived in a double-wide trailer off Deer Running Road in Somerville. Mr. Magee, he said, had been cultivating marijuana hydroponically in the front left bedroom. When Mr. Hall had last been there, not long before his arrest, he had seen a dozen six-foot stalks ready for harvest.

“I mean, you open the door and it reeks like weed,” he said.

He told the investigator that Mr. Magee went by Hank, and that he was white and close to 30 years old. He had a girlfriend and worked intermittently as a roughneck in the oil fields. When off the rigs, he liked to ride dirt bikes and shoot guns out behind his trailer.

Mr. Hall skirted any direct negotiation for leniency until the end of the conversation. “I don’t need prison,” he suggested, scratching his scalp. “I need rehab, man.”

“That’s going to be up to the courts; you know that,” Investigator Hermes replied.

Show of Force

He tapped his pen on his notepad. Had Mr. Magee ever said what he would do if law enforcement showed up?

“He’s a laid-back guy, he really is,” Mr. Hall answered. Then again, he said, he had seen two rifles and three handguns at Mr. Magee’s place: “I mean, the boy is ready for war — with who I don’t know. I’m just giving you that information because if the boy does grab a hold of a gun, try not to shoot him.”

The investigator answered dryly, “Yeah, I don’t wake up every day wanting to shoot somebody.”

“But I can understand if y’all’s life is put in danger,” Mr. Hall said.

“Right,” the deputy said, “well, that’s a bad thing when somebody grabs a gun when we walk up.”

ALREADY SADDLED WITH A HEAVY CASELOAD, Investigator Hermes shared a video of the interview with a colleague, Fredrich Adam Sowders.

Burly and bearish, with a close-cropped sponge of ginger hair, Investigator Sowders (pronounced SO-durs) had spent all of his 31 years kicking about the prairie dust of Burleson County (population 17,000, and 53,000 cattle). His family was well known in Somerville, where his grandfather had owned the Gulf station and his mother managed the Wine & Roses florist shop.

Investigator Sowders had been drawn to law enforcement since at least age 16, when he followed his father and grandfather into volunteer firefighting. While other boys studied baseball cards, young Adam memorized police scanner codes. He had joined the Sheriff’s Office in 2006, after a stint as a town police officer. The sheriff named him officer of the year in 2011 and promoted him to sergeant investigator in 2013. Friends and fellow officers called him Big A.

The investigators knew Mr. Hall was untested as an informant. But there is nothing in court documents to suggest that they took steps to corroborate his story, or even to pull his criminal record. Nor did they arrange for a “controlled buy” through an undercover agent. Their sleuthing, it seems, consisted largely of driving past Mr. Magee’s trailer to take photographs.

Nonetheless, five days after getting the tip, Investigator Sowders consulted the district attorney’s office and typed an application for a search warrant. In a three-page affidavit, he summarized Mr. Hall’s allegations and described the trailer’s location. He closed by asking for authority to raid the residence without first knocking on the door, a tactic allowed by the Supreme Court when the police demonstrate a “reasonable suspicion” that announcing themselves beforehand would be dangerous or risk destruction of evidence.

The deputy omitted Mr. Hall’s description of his “laid-back” friend, and wrote,“Hall advised that Magee has made the statement that he is not afraid to use the weapons that he has.”

The affidavit also did not disclose that Mr. Hall was trying to cut a deal from jail. Instead, Investigator Sowders wrote that the interview took place “at the Sheriff’s Office” (which is in the same building). He did not mention that Mr. Magee had no record of violence, only misdemeanor convictions for marijuana possession and intoxicated driving. The affidavit also did not disclose, because the investigators did not know, that Mr. Magee’s girlfriend, Kori White, was four months pregnant.

That afternoon, the deputy had the warrant signed by a district judge, Reva L. Towslee Corbett. It authorized him “to dispense with the usual requirement that you will knock and announce your purpose before entering.”

Demonstrating Suspicion Bell County

Three months later, 85 miles to the northwest, another informant found cause to give up an acquaintance. This time, it concerned a career criminal named Marvin Louis Guy, who the informant said was dealing cocaine from his car outside a rough-and-tumble apartment complex in Killeen.

Mr. Guy, then 49, had lived a far more hardened life than Mr. Magee. Raised in East Chicago, Ind., near Gary, he had lost both parents by age 9. He and his siblings were split up among relatives, and soon enough the streets beckoned. He joined the Gangster Disciples, dropped out of 11th grade and never avoided trouble for long: fighting, theft, battery, bank robbery, possession of a firearm as a felon, probation violation, cocaine possession. He had spent two-thirds of his adult years behind bars. That history had left him with a wariness that family members considered paranoid. But he could also charm with his gaptoothed smile and engaging manner. And lately, he had been on something of a roll.

He had stayed out of prison for nearly four years and moved to Killeen, home of Fort Hood, where his half brother Garett Galloway had settled after serving in the Army. Three other siblings had followed. Although unemployed for the last few months, Mr. Guy had otherwise managed to find steady work as a night-shift dishwasher. He had an apartment of his own and a 2005 Ford Crown Victoria.

Best of all, one day at the gym nearly three years earlier, he had met an attractive and spirited widow named Shirley Whittington. She was a year older, a former correctional officer who worked as a cashier at Walmart. Their relationship could be tempestuous, and they kept separate households. But Mr. Guy’s siblings noticed that he was dressing better and sometimes even accompanied Ms. Whittington to the Christian House of Prayer.

“He was getting himself together,” Mr. Galloway said.

By Mr. Guy’s own admission, that did not mean he wasn’t smoking weed and, on occasion, consuming cocaine. The informant, who has not been publicly identified, said it went further. He told a narcotics investigator, Officer John A. Moseley, that a heavyset black man known to him as “G” sold drugs from a blue Crown Victoria on Circle M Drive, according to an affidavit. Officer Moseley knew that the rows of fourplexes on Circle M had long been a hot spot for street crime and drugs.

Unlike his counterparts in Burleson County, Officer Moseley followed up with some basic legwork. He eyeballed the Crown Vic in front of the beige brick apartment building at 1104 Circle M and traced the license plate to Mr. Guy. A police database placed the suspect in Apartment C, ground floor, right side.

Agents watched the apartment intermittently during April, noting heavy foot traffic and encounters with Mr. Guy in his car. They sent the informant back to confirm that Mr. Guy still had cocaine, but did not arrange for a buy. He reported that Mr. Guy regularly carried a handgun.

On the afternoon of May 8, Officer Moseley typed up an affidavit and requested a no-knock search warrant. He took it to Mark D. Kimball, a municipal judge, who reviewed it for five minutes and affixed his signature.

Big Risks and ‘Minimal’ Training Burleson County

Mr. Magee’s family had been in Burleson County since 1979, when his grandparents bought a 475-acre cattle ranch. The oldest of three children, he attended Catholic school and then worked as an auto mechanic before shifting to the oil fields, where he earned $2,600 in a week of 12-hour shifts.

Mr. Magee, 28 at the time of the raid, had been seeing Kori White, then 21, for about a year and a half. She was waifish and freckled, with wavy, shoulder-length brown hair. He was dark and handsome, with an easy smile. Once she got pregnant, they began planning a future that included building a house and perhaps starting a tree farm.

Mr. Magee did not exactly hide his fondness for marijuana. But Ms. White said that he never told her explicitly what he was doing behind the locked door, and that she never witnessed a transaction.

“I was so in love,” she said. “If there was something I didn’t want to see, maybe I just didn’t see it.”

THE BURLESON COUNTY SHERIFF’S OFFICE had only 16 sworn officers and a $2.2 million budget when Hank Magee came to its attention in December 2013. By the standards of the National Tactical Officers Association, it was too small to field even a part-time special weapons and tactics team. But like scores of tiny jurisdictions around the country, it had one anyway.

Riots and shootouts, the scenarios that gave rise to SWAT teams in the late 1960s and 1970s, were rather rare in rural Texas. The Sheriff’s Office had been averaging about 50 arrests a year, and its home page featured mug shots not of its most wanted but of impounded stray heifers.

The Burleson deputies often summoned a SWAT team from a larger agency on the rare occasions when high-risk search warrants were to be served. Their own training for such operations was “minimal,” according to Julie Renken, the district attorney for the county.

But for the raid on Mr. Magee’s trailer, they went it alone. “I think they felt they had asked for too much help,” Ms. Renken said.

Once Investigator Sowders had a signed warrant, he and other deputies planned their dynamic entry. There would be 10 of them, virtually every officer on the roster. Before sunrise on Dec. 19, they would stealthily roll their vehicles across a cattle guard and down the dirt path to Mr. Magee’s trailer.

Some would stack up at the door while others fanned out to intercept any runners. A flash-bang grenade would be detonated outside Mr. Magee’s bedroom window to disorient him with an intense blast of light and sound. As one deputy heaved a steel battering ram at the door latch, the others would shout: “Sheriff’s Office! Search warrant!” When the door swung open, a second flash-bang would be tossed toward the bedroom.

THAT NIGHT, AFTER WORKING a double shift as a waitress, Ms. White picked up a chicken-tender salad and headed to the trailer. She and Mr. Magee wrapped Christmas gifts and settled on the couch to watch television, falling asleep before midnight. At some point, Mr. Magee slid to the floor to give her more room. The only light shone dimly from the bulbs on a miniature artificial tree.

By about 5:40 a.m., the deputies were in place. They wore uniforms as dark as the night sky, with lettering that revealed their identities — “Sheriff’s Office” — only on the back.

They had a description of the trailer’s interior from the informant. But because they confused his directions, plotting their entry from the front rather than the back, they thought Mr. Magee’s bedroom was to the left when in fact it was to the right. When the first flash-bang detonated outside the wrong end of the trailer, it did not immediately awaken the couple.

Then came a crashing thud at the door. “Hank, what was that?” Ms. White asked.

“Who is it?” Mr. Magee shouted, according to Ms. White. “Who’s there?” No answer, then another thud at the door.

Mr. Magee scrambled into his bedroom and retrieved an AR-10 semiautomatic rifle from a closet. As he re-entered the living room, the front door burst open, followed by a deafening explosion. Ms. White screamed as a dark figure crossed the threshold.

“I thought we were being robbed,” she said. “It was my worst fear, that it was like on TV with people kicking in the door and coming in.”

Mr. Magee raised the rifle and fired several times toward the door, just above Ms. White on the couch. She jumped up and dashed toward him, brushing her neck against the steaming barrel, then dropped to the floor and crawled into the bedroom.

“I still didn’t know who it was or what was going to happen,” she said. “I just knew my best bet was getting as low as possible and getting out of that room.”

Only then, she said, did she hear the announcement: “Burleson County Sheriff’s Office! Come out with your hands in the air.”

Mr. Magee dropped the rifle and complied. Ms. White followed him out the door, stepping over a broad-shouldered body as blood pooled on the wooden flooring. Although wearing body armor, Adam Sowders had been struck in the head.

The couple were thrown to the ground, handcuffed behind their backs and placed in separate squad cars. While waiting for what seemed like hours, Ms. White felt her baby kick for the first time, as if to signal that she was O.K.

At the county jail, Mr. Magee spoke voluntarily to a Texas Ranger, insisting that he had not heard the deputies announce themselves and that he had fired in self-defense when he saw someone bursting through the door. It did not matter. At the end of Ms. White’s interview, an investigator explained that Mr. Magee would be charged with killing a peace officer, a capital crime carrying a possible death sentence.

“That’s the moment I realized this was real,” Ms. White said, “that I wasn’t just going to go home with Hank that day.”

Later that day, two state investigators finished searching the trailer. Their total haul, according to an inventory of seized property, consisted of 10 cannabis plants and a few Mason jars and baggies of marijuana. All told, it weighed 4.39 ounces, just above the four-ounce threshold separating misdemeanor from felony possession. Among the other items logged in the inventory were three rifles, two handguns and the “Body of Adam Sowders.”

‘Like the Fourth of July’ Bell County

Marvin Guy recalls having an eerie feeling about that night. It was hard to pinpoint, but he felt unsettled, as if being watched. The complex was already on edge, as only five nights earlier, directly across the street, a burglar had broken through the window of a ground-floor unit like his and nearly choked a young woman to death.

Mr. Guy said he told his girlfriend, Shirley Whittington, that he did not feel comfortable staying at his apartment. Ms. Whittington pushed back, but to no avail. As she waited in the apartment, he spent much of the night in his car, he said, driving aimlessly and catching an occasional nap. After 1 a.m., he dropped in on his half brother, Fred Galloway, who lived nearby, and voiced his fears.

“Ain’t nobody watching you, man,” Mr. Galloway said. “Now just go home.”

By 3 a.m., Mr. Guy had returned to the apartment and positioned a green recliner under the front doorknob to deter intruders. He and Ms. Whittington argued again, heated enough that she stayed in the master bedroom in the back while he retired to the spare bedroom looking onto the street. He fell asleep on a mattress on the floor, two semiautomatic handguns within reach: a 9-millimeter and a .45-caliber. He knew that as a felon he was barred from possessing them.

Not long after, Detective Charles D. Dinwiddie, a leader of Killeen’s SWAT team, began briefing his men at the North Precinct. Known for his technical skills and an endearing impishness, Detective Dinwiddie, 47, had served 18 years on the Killeen police force, 15 of them on SWAT. With his military bearing, squared-off buzz cut and deeply dimpled chin, he more than looked the part.

Killeen’s part-time SWAT team at the time trained once a month and averaged about 25 deployments a year, said Patrick Turck, a former assistant commander. Perhaps 10 would be in response to barricaded suspects or violent domestic disputes. The rest were to execute narcotics search warrants, usually no-knocks, Mr. Turck said.

At about 5:40 a.m., as Mr. Guy’s neighbors began waking for work and school, 20 rifle-bearing SWAT officers hustled down Circle M Drive like a platoon ready for combat. Low clouds strained the moonlight.

According to excerpts from police reports obtained by The New York Times, six officers surrounded Mr. Guy’s car, thinking he might be inside. An officer on each side shattered the darkened windows, but found the car unoccupied. Another smashed the front bedroom window with a metal pole and pulled back the blinds. His partner illuminated the interior with the light mounted on his rifle but did not see anyone. On the back side, a three-man team broke the master-bedroom window.

Simultaneously, nine officers lined up at the front door. The first in the stack, Detective Byron K. Goodsby, slammed it with a battering ram. Detective Willie H. Wingfield pulled the pin on a flash-bang and prepared to toss it inside. Barricaded with the armchair, the door gave only an inch. Detective Goodsby took a second swing, and then a third, with no success.

“Secondary!” Detective Dinwiddie called, signaling that the entry team should attack the back door. They reversed course, leaving themselves exposed to the window of the bedroom where Mr. Guy had been sleeping.

Mr. Guy says he had his back to the window when he was awakened by shattering glass. He insists that he did not hear any announcement and thought he was being robbed. He grabbed one of his guns, sprang to his feet on the mattress, gripped the weapon with both hands and began firing, he says. The officers saw the orange glow of muzzle flashes spitting from just inside the opening.

Detective Goodsby dropped the battering ram and dived for cover. As Detective Wingfield darted to his left, he slipped on damp grass and dropped the armed flash-bang grenade. As he bounced to his feet, a thunderous boom reverberated down the block, and dense smoke billowed up the stairwell.

“Shots fired!” someone yelled. One officer in the stack switched his rifle from “safe” to “semi” and fired six rounds toward the window. Detective Wingfield took a knee and started shooting at the front door, pulling the trigger a dozen times. The men on the parking pad ducked behind cars.

Ms. Whittington woke to the commotion – she later said it sounded “like the Fourth of July” — and crawled into a closet.

Officer Odis Denton, the sixth man in the entry formation, felt a searing pain in his upper left thigh. “I’m hit, goddamn it, I’m hit,” he said.

As the smoke cleared, the team could see a second officer on the ground. It was Detective Dinwiddie, lying on his left side, about a dozen feet from the door. He had a large hole in his right cheek, two inches below the eye. “Officer down,” someone screamed. “Chuck’s hit. Medic!”

Despite his injury, Officer Denton managed to raise his rifle to his shoulder and squeeze off eight rounds toward the silhouette in the window. Others held their fire, fearing they might hit a team member. Finally the gunfire quieted, though the officers did not know if the suspect had been hit or was simply reloading.

Two officers dragged Detective Dinwiddie’s motionless body out of the line of fire, and a third pulled Officer Denton to safety. As a medic wrapped a tourniquet around his thigh, Officer Denton reached out and grabbed Detective Dinwiddie’s leg. “Wake up,” he pleaded. “Don’t give up! Fight!”

The wounded policeman did not seem to be breathing, and an officer started chest compressions. “Stop for a second,” the medic said. He placed his fingers on the right side of Detective Dinwiddie’s neck. “He’s got a pulse,” he announced, “but it’s weak.”

MR. GUY SAYS HE EVENTUALLY HEARD shouts that it was the police. He ditched his gun by the bedroom window and ran toward the back door, cutting his feet on shards of glass. He emerged wearing a gray tank top and dark basketball shorts.

“Don’t shoot me, I’m not armed,” he pleaded. An officer targeted his chest with his rifle laser, and issued staccato commands: Keep your hands in plain sight. Walk toward my voice. Drop to your knees. Put your hands on your head. Get down on your stomach.

The agents approached Mr. Guy cautiously. Once upon him, Officer Juan E. Obregon Jr. shoved a knee between Mr. Guy’s shoulder blades and put a pistol to his head. Only 10 months earlier, Officer Obregon had been shot in the leg during a SWAT operation in which a fellow officer was killed, the department’s first fatality since 1917.

“If you move I will kill you,” Officer Obregon told Mr. Guy, cursing wildly, according to excerpts from accounts by both the officer and Mr. Guy. “Who is inside? Who shot?”

Fearing for his life, Mr. Guy blurted that there was a woman inside: “She was shooting!” he said.

The officer grew more agitated when he heard that Detective Dinwiddie had been hit. As Mr. Guy tried to speak, Officer Obregon struck him in the mouth with his gun before others pulled him away, according to the officer’s own statement.

The officers called Ms. Whittington out of the house. Wearing a black gown with white polka dots, she flipped the recliner and opened the front door. When she hesitated to drop to the ground, an officer tackled her with such force that her head hit the sidewalk. She was later found to have two broken ribs.

The No-Knock Raid on Marvin Guy’s Apartment Marvin Louis Guy insists he did not know he was shooting at the Killeen, Tex., SWAT team. The police say he must have known. This reconstruction is based on excerpts from police reports, transcripts of police interrogations and interviews with Mr. Guy, who asserts that the casualties resulted from friendly fire. Mika Gröndahl and Shreeya Sinha/The New York Times

At a hospital, doctors discovered that a single slug had moved through Detective Dinwiddie’s jaw, throat, first vertebra and spinal cord before lodging near the base of his brain. Paralysis had been instantaneous. After a two-day vigil, his family agreed to remove him from life support. He left a wife of 22 years and two young children.

Tests at the state crime lab concluded that the bullets removed from Detective Dinwiddie’s spine and Officer Denton’s leg had been fired by Mr. Guy’s Taurus Millennium 9-millimeter Luger, according to an affidavit by a district attorney’s investigator. An evidence log said the gun was found on the bedroom floor, near the window, its magazine empty. The .45-caliber pistol was discovered under a pillow on the bed, with one cartridge in the chamber and nine in the magazine, according to an investigator’s statement.

The processing of the crime scene showed that it had been quite a firefight. In just a few seconds, the police shot at least 41 rounds, and they reported finding nine 9-millimeter casings inside the apartment. Bullet holes were everywhere — in the door and window frames, in a television and refrigerator, in flattened car tires.

The investigators said they seized two digital scales from Mr. Guy’s car, one bearing flakes of white powder. Officer Moseley, the narcotics investigator, also reported that they found powdery residue on the floorboard, on a red plate in the trunk of Ms. Whittington’s car and in baggies in two outdoor garbage cans.

But that was it. The total take from the raid that led to the death of Charles Dinwiddie and the wounding of Odis Denton, according to Officer Moseley’s affidavit, amounted to “approximately one gram of suspected cocaine.”

Considering the Alternative Burleson County

Almost two months after the killing of Adam Sowders, 12 grand jurors convened on the third floor of the Burleson County Courthouse to decide whether Hank Magee should be indicted on a charge of capital murder.

The previous weeks had been wrenching for all sides. Investigator Sowders had been buried in the back row of Oaklawn Cemetery, his black granite headstone bisected by a thin blue line. It was etched with his date of birth and, rather than a date of death, his “end of watch.” Tokens of his calling — a toy police car, a jail key, a bullet — had been placed at the foot of the slab.

Mr. Magee remained behind bars on $1 million bond, despondent that he had taken a life, and that he might never hold his child. Eerily, Mr. Magee and his father, Henry, realized they had met Investigator Sowders several years earlier when he came to the ranch to take a report on some missing dirt bikes.

His father managed to hire a prominent Houston defense lawyer, Dick DeGuerin, whose client list has included Robert Durst, the real estate heir accused of murder, and the former House majority leader Tom DeLay. A Texan from the brim of his straw Stetson to the toe of his black boots, Mr. DeGuerin began making the case to the local media that the deputy’s death had been “a tragic accident.” He argued that the use of force had been disproportionate for a minor drug suspect, and that Mr. Magee, “like any homeowner,” had fired in self-defense.

The district attorney, Julie Renken, believed that the no-knock warrant had been legal. But to convict Mr. Magee of capital murder, she would have to prove that he had known his victim was a law enforcement officer. Otherwise, he had an arguable right to defend himself against a perceived threat of deadly force. On that score, Ms. Renken, in her first year in office, saw troubling flaws in the chaotic execution of the raid.

The evidence indicated that the deputies had not announced themselves clearly before smashing through the door, she said in an interview. That Mr. Magee complied quickly with the first audible commands to exit the trailer suggested that he had not known what was happening.

“Just because something’s done legal does not mean it’s done procedurally well,” Ms. Renken said.

Listen to Your Daily Audio Report This is how the news should sound. Twenty minutes a day, five days a week, hosted by Michael Barbaro and powered by New York Times journalism.

The grand jurors — 11 whites and one Hispanic, in a county that is more than 80 percent white — met for more than 12 hours, hearing from every deputy involved. They also heard from the Texas Ranger who investigated the shooting and from Ms. White, who testified tearfully that she and Mr. Magee had not known it was the police who had broken through their door. Ms. Renken said she made no recommendation, as is her practice in self-defense cases.

The grand jurors did not waver, said Jack R. Sullivant, a retired welding-equipment salesman who served on the panel. “Everyone in the room felt very much as I did that the sheriff’s people literally blew it,” Mr. Sullivant said. “Why in the world would you do a full-out assault on a guy growing pot? They could have picked him up at the grocery store, at the gas station, at his job.”

Mr. Sullivant said the deputies knew Mr. Magee had guns and would be wary of robbers. “All of us felt that if I were in bed and heard anything that made me get up and get a gun, and all of a sudden my door explodes in, I’m shooting,” he said. “To a one we felt he had a right to protect his home. If they had announced themselves it would be a different situation, but they didn’t, and because of it a good man lost his life.”

Dale Stroud, who retired in November after 12 years as Burleson County’s sheriff, declined to discuss the raid but said his department had not used no-knock tactics since. “It would have to be warranted under the most extreme circumstances,” he said.

The grand jury indicted Henry Goedrich Magee II only on a count of possession of more than four ounces of marijuana while using a deadly weapon, a third-degree felony punishable by two to 10 years in prison. He was freed the next day on a reduced bond of $50,000 and came home to the ranch for a tearful reunion.

Ms. White delivered their daughter, Laila, three months later, but the couple never recovered from the raid and split up before the end of the year. Mr. Magee still lives with Laila in the trailer where the deputy was killed. His pending charges make him unemployable in the oil patch, but he has found work remodeling houses with a friend. He has lived freely for nearly three years, awaiting a trial scheduled for April 3.

Mr. Magee declined to discuss details of the shooting on the advice of Mr. DeGuerin and his law partner, Todd Ward. But his father spoke on his behalf.

“All they had to do was knock on the door in the daylight and he would have answered,” the elder Henry Magee said. “He would have gotten in trouble, but no one would have died. It was all avoidable.”

Mr. Magee’s lawyers are concerned that jurors in his drug trial will seek to punish him for the death. “Our argument,” Ms. Renken said, “is that but for his illegal operation, our deputies would never have been there.”

In the Name of Safety Bell County

Despite their proximity and common circumstances — no-knock raids in the dead of night, leading to the deaths of officers and yielding only small seizures — Marvin Guy faces a much more ominous fate than Hank Magee.

Parsing why is complicated. Mr. Guy is black and poor and unlike Mr. Magee could not afford private lawyers. He had a far lengthier criminal record (although more contraband was seized from the misdemeanant, Mr. Magee, than from the career felon). And when the Bell County grand jury met, there were no sympathetic witnesses to support Mr. Guy’s assertion that he had not known he was firing at the police, the central question in the panel’s deliberations.

“We thought there was no way he could not know it,” recalled one of the grand jurors, Lee Ann Deal. “The police identified themselves as they were going in, as I remember it. He may have at first been shocked into thinking he was defending himself against intruders. But it couldn’t have taken very long for him to realize it was the police.”

Exactly what evidence the grand jurors heard and did not hear is cloaked in confidentiality. But there is a certain amount of ambiguity in the record.

About the Data A full list of fatalities resulting from forcible-entry search warrant raids from 2010 to 2016, tallied by The Times, along with demographic details.

Typically in no-knock raids, which are, after all, intended to catch suspects unawares, officers yell “police, search warrant” only as they storm into a residence. In the after-action reports viewed by The Times, eight Killeen officers are recorded as saying they gave such notice while 14 said they heard others do so.

But a dozen more officers did not mention any announcement. Ms. Whittington told investigators that she heard no voices before the gunfire. And of 65 neighbors and other witnesses who said they heard the battering ram, the flash-bang or gunshots, only 10 mentioned to police interviewers that they first heard shouting.

Mr. Guy had given his own account to two Killeen officers shortly after being booked into jail. He began by remorsefully exonerating Ms. Whittington. Then he steadfastly asserted that the only thing he heard before opening fire was the window breaking.

“I was just trying to protect myself,” he said, according to a partial transcript of the interview. “Nobody got on the loudspeaker and said, ‘This is the Police Department, come out.’ If they would have done that, I would have never grabbed a gun and started shooting. I thought it was some neighborhood kids trying to come in and do me harm.” He added, “I just did what an average natural person would do.”

The officers countered that Mr. Guy had to have heard the announcements, that if he thought he was being robbed he would not have dropped his gun before heading for the back door.

Mr. Guy wept when told that policemen had been hit. He said it had happened so fast he could not even be sure which gun he had fired, or how many rounds.

Although he admitted being a drug user, Mr. Guy denied selling. Ms. Whittington backed that story in her own police interview, saying she had never seen him deal, according to a transcript.

Mr. Guy did acknowledge that he was not supposed to have a gun, but explained that street life made it necessary. “I’d rather be judged by 12 than carried by six,” he told the officers.

The grand jurors heard from a number of SWAT team members, but not from Ms. Whittington or Mr. Guy. “All the witnesses were officers, as I recall,” said Ms. Deal, a longtime executive for nonprofit agencies.

The grand jury indicted Mr. Guy on counts of capital murder and attempted capital murder. Four months later, the district attorney, Henry Garza, announced that he would seek the death penalty. (Because the judge later imposed a gag order, Mr. Garza declined to be interviewed, as did Killeen’s former police chief, Dennis M. Baldwin, and various officers. The department also rejected requests for internal and external reviews of the case.)

Although Bell County’s population was 22 percent black, there were no African-Americans on the grand jury. But Ms. Deal and another grand juror, Sandra Horn, said it played no role that Mr. Guy was black and Detective Dinwiddie white.

“I don’t think race was ever a factor in our decision,” Ms. Deal said. “Not at all, and I’m pretty sensitive to those things. I’m a liberal person living in a pretty conservative area and believe all people are created equally in the eyes of God.”

Mr. Guy disagrees. “It has everything to do with my race and a racist system of justice,” he said in one of numerous telephone interviews and letters from jail over the past year.

He cannot resist contrasting his plight with Mr. Magee’s. “This Henry Magee shot and killed a police to protect his lady and himself, but he is free because people found that the no-knock was the problem,” he said. “This was a lynch mob. That’s what no-knock is.”

Yet Mr. Guy has frustrated several court-appointed lawyers by insisting that they present a narrative that obscures questions of self-defense: that the police and prosecution have framed him to cover up a death by friendly fire.

He now says he did not shoot the 9-millimeter handgun that investigators and ballistics experts say killed Detective Dinwiddie. Instead, he says, he picked up the .45-caliber weapon and fired two to four times out the window at a downward angle. He argues that the police then planted the 9-millimeter shells in his bedroom as well as the traces of cocaine in the garbage cans.

Asked if he believed that dozens of Killeen officers, state investigators, crime lab experts and prosecutors had joined in a conspiracy, Mr. Guy said: “Yeah, this is what happened. They’re never going to admit to shooting that hero cop in a crossfire.”

Citing the gag order, Mr. Guy’s current lawyer, Carlos Garcia of Austin, would not discuss the case. But Michael F. White, one of several lawyers dismissed by Mr. Guy, said he had explored the friendly-fire theory and found no backing. What he did find, he said, was support for a claim of intellectual disability, an approach he said Mr. Guy refused to accept.

“I think he has a great chance, but Marvin’s not willing to help himself, even though it might save his life,” Mr. White said. “I think he’s rewritten history in his mind.”

Nearly three years after the shootings, Mr. Guy still does not have a trial date.

The authorities, naturally, argue that suspects like Mr. Guy and Mr. Magee, through their alleged illegal activities, set into motion the deaths of Charles Dinwiddie and Adam Sowders. But Mr. White said responsibility also lay with law enforcement for embracing militaristic tactics that unnecessarily inject violence and risk into relatively minor drug searches.

Got a confidential news tip?

“The error was in the way they conducted the SWAT operation, doing a no-knock instead of waiting for him to come out,” he said. “They put the whole neighborhood in danger. The risk-reward just doesn’t make any sense.”

Mr. Guy debated that very point with his police interrogators during their jailhouse interview.

One officer, according to the transcript, explained that the “protocol on high-risk search warrants is no-knock — it’s for officer safety.”

“Oh, I didn’t know,” Mr. Guy said.

“A lot of other states have gone to that as well,” the policeman added.

“It would have been a lot easier if someone would have announced themselves, man,” Mr. Guy offered.

“There are pros and cons,” the officer responded. “You say if they would have done so you would have come out. They don’t know that. All they know is they’re looking at a man who spent a lifetime in prison, who has weapons. They don’t know you’re just going to come out of that door peacefully.”

But in this case, he acknowledged, the gamble had failed. “Bad situation. Went down bad.”

Update: On March 27, a week before his trial date, Hank Magee pleaded guilty to felony possession of marijuana in a deal for 18 months in prison, which is less than the statutory minimum sentence. Mr. Magee got credit for the 50 days he served after his arrest for capital murder of a peace officer, before the grand jury chose not to indict him on that charge.

Read the first installment in this series.