A federal appeals court on Thursday upheld the convictions and prison sentences of two Detroit narcotics officers, concluding they schemed with drug dealers to line their own pockets — just as the jury concluded.

“Bryan Watson and David Hansberry worked as undercover narcotics agents for the Detroit Police Department. As it turned out, they were dirty cops — using their positions as police offices to steal drugs and money from drug dealers,” the 6th Circuit U.S. Court of Appeals wrote in its opening paragraph of a page opinion.

The 6th Circuit, however, noted that this case wasn’t about whether the officers committed a crime, but rather figuring out what crime they committed.

More:Feds: Corrupt Detroit cop threw money at strippers, hair doc, cars

More:Feds weave tale of crooked cops, big money, big schemers

The government charged them with conspiracy to commit extortion. The jury agreed and returned a guilty verdict.

But Hansberry and Watson argue they committed robbery, not extortion, and therefore their sentences must be tossed.

The 6th Circuit disagreed.

“The government introduced enough evidence at trial to support defendants’ extortion convictions,” the appeals court wrote, echoing the sentiments of the federal judge who oversaw the 2016 trial.

For U.S. District Judge Stephen Murphy, who also refused to toss the convictions, especially convincing in the case was a secretly-recorded conversation in which a major drug dealer and the accused officers discussed the alleged scheme.

"That conversation alone would likely be sufficient evidence on which to convict the defendants," wrote Murphy, who also noted that testimony about suspicious income and expenditures by the officers, bogus search warrants and fake cocaine also weighed against the defendants.

Hansberry, 37, is serving a nearly 13-year-prison sentence, or 155 months; Watson, 49, was sentenced to 108 months. They have long maintained that they did nothing illegal, but were trying to take down major drug traffickers in Detroit, and that part of that job entailed earning the trust of and talking with drug dealers and unsavory individuals who could tip them off. They claim those individuals got busted and then turned on the officers to save themselves.

The defense argued that the officers were targeted by an overzealous government that built its case largely on the lies of drug dealers who had an ax to grind.

Hansberry and Watson were convicted on one count of conspiracy to commit extortion, but acquitted on all nine other substantive counts. That didn't make sense to the defendants. Their lawyers wanted the guilty verdict set aside, arguing the only thing the officers were convicted of was conspiring — or plotting — to steal from others, not the actual theft of anything. And that, they have argued, is a huge difference.

"It was gratifying to see that the jury clearly rejected most of the government's case, including the testimony of the numerous dope dealers who were given plea deals to testify against the officers," Watson’s lawyer, Steve Fishman, has previously said.

Hansberry and Watson also challenged other issues, claiming, for example, that the jury instructions were improper and confusing and that a government witness made false statements in the case.

The prosecution meanwhile, has argued there was plenty of evidence to show that the police officers used their jobs to steal drugs and money that should have been turned in as evidence, and that they used their status as law enforcement officers to scare and intimidate individuals into giving them their drugs and money to avoid prosecution.

The trial judge agreed. So did the 6th Circuit.

“None of these challenges warrant a retrial or resentencing,” the appeals court held.

According to court documents and trial testimony, here is the scheme that Hansberry and Watson ran for while working the DPD narcotics division:

The cops would raid a house or stop a car — generally with the help of an informant — knowing that drugs and money would be there. These raids would surprise the drug-dealing victims, and as several of them testified, would scare them “to death” about getting arrested or hurt. So they would hand over their drugs and money to the officers.

Once Hansberry and Watson got what they wanted, they would leave without making arrests or filing charges. Instead, they would keep the money and sell the drugs, generally with the help of the same informant, and splitting the profits.

And if the officers did report the bust, they would first take some money or drugs “off the top.” For example, if they seized $100,000, they would keep $20,000 and report only $80,000. Or if they seized 10 kilos of cocaine, they would keep 2 kilos and report only 8 kilos.

Other witnesses testified about their interactions with the officers. Several victims, facing arrest or criminal charges, agreed to give the officers drugs and money. In exchange, the officers agreed to protect them from arrest or make the charges disappear.

Hansberry has argued that his sentence was unreasonable because it was a harsher than Watson and other codefendants received. But prosecutors have convinced the courts to let the sentence stick, arguing Hansberry was a sergeant and leader in the scheme.