
548 F.3d 200 (2008)
Tyrone HARRIS, Petitioner-Appellee,
v.
George B. ALEXANDER, Chairman, New York State Department of Parole and Andrew M. Cuomo, New York State Attorney General,[1] Respondents-Appellants.
Docket No. 07-3920-pr.
United States Court of Appeals, Second Circuit.
Argued: October 16, 2008.
Decided: December 4, 2008.
*201 Robert J. Budner, Legal Aid Society, New York, N.Y., for Petitioner-Appellee.
Frederick H. Wen, Assistant Attorney General of the State of New York (Andrew M. Cuomo, Attorney General of the State of New York, Barbara D. Underwood, Solicitor General of the State of New York, Roseann B. MacKechnie, Deputy Solicitor General for Criminal Matters of the State of New York, on the brief), New York, N.Y. for Respondents-Appellants.
Before: McLAUGHLIN, LEVAL, POOLER, Circuit Judges.
LEVAL, Circuit Judge.
George B. Alexander, Chairman, New York State Department of Parole and Andrew M. Cuomo, New York State Attorney General, appeal from judgment of the United States District Court for the Southern District of New York (Scheindlin, J.) entered on August 16, 2007, granting to Tyrone Harris a writ of habeas corpus pursuant to 28 U.S.C. § 2254, setting aside Harris's conviction for possession of a controlled substance with intent to sell, N.Y. Penal Law § 220.16(1). The district court's ruling was based on its conclusion that Harris was convicted without due process of law, and the state courts unreasonably applied Supreme Court rulings in affirming his conviction, where the trial court refused, in violation of standards established in New York law, to instruct the jury on the theory of Harris's defense. We agree and therefore affirm the district court's grant of habeas corpus.

BACKGROUND
Harris was tried and convicted in the New York State Supreme Court, New York County, of possession of a controlled substance with intent to sell, N.Y. Penal Law § 220.16(1). The evidence at trial was as follows. On February 16, 2001, at approximately 12:45 a.m., a police officer conducting surveillance of street activity from a rooftop observed what he believed to be a narcotics transaction at the corner *202 of 47th Street and Eighth Avenue in Manhattan. According to his testimony, two men approached the petitioner Harris, who appeared to show them glassine bags. The two men shook their heads and walked away. Then, another man approached Harris. After a brief conversation, the man handed Harris what appeared to be currency, and Harris handed the man a small object. The man entered the vestibule of a nearby business and proceeded to smoke what the officer assumed to be dope purchased from Harris. The officer radioed to a field team, which responded to the scene and arrested Harris, finding him to be in possession of seventeen glassine bags of crack-cocaine and $56.
The People also offered Harris's grand jury testimony. In his grand jury testimony, Harris described having run into a female companion, a prostitute, with whom he was "trying to connect . . . that night." She gave him approximately $175 to buy her some crack-cocaine, and he had about $45-$50 of his own money. Harris explained that the drugs were for "[b]oth of us," and that they had "hooked up before in this manner." The companion and Harris arranged to meet later that night on 47th Street and go to a hotel. Harris then bought 20 bags of cocaine from a street runner sometime between 10:30 p.m. and midnight. He smoked three of the bags prior to his arrest. Upon his arrest, Harris denied that he had sold or offered drugs or intended to do so, insisting that he intended only to share the drugs with his female companion, at whose request he had acquired them.
During the pre-charge conference and several times thereafter, Harris's counsel requested that the jury be instructed on the agency defense to a charge of intent to sell. As an exception to the usual New York rule that any transfer of illegal drugs to another person is considered a sale, the agency defense, which is discussed at greater length below, generally posits (with some exceptions) that, where a defendant has acquired drugs acting as the agent of a would-be purchaser, his delivery of those drugs to his principal is not considered a sale. See, e.g., People v. Chong, 45 N.Y.2d 64, 73, 407 N.Y.S.2d 674, 379 N.E.2d 200 (1978); People v. Andujas, 79 N.Y.2d 113, 117, 580 N.Y.S.2d 719, 588 N.E.2d 754 (1992). By the same token, such an agent's possession of the drugs, with the intent to turn them over to his principal, is not deemed possession with intent to sell.
The trial court denied Harris's request to charge the agency defense. Instead, the court said it would instruct the jury, in accordance with the usual New York rule, that any transfer of illegal drugs to another person, including a gift, constitutes a sale. On that basis, the prosecutor argued in summation that, under the court's definition, Harris's admitted intent to transfer the cocaine to his female companion constituted intent to sell the drugs. The jury found Harris guilty of possession with intent to sell, and the court sentenced him as a second felony offender to a term of 4½ to 9 years in prison.
The Appellate Division of the New York Supreme Court affirmed the conviction, ruling that the evidence did not support an inference that Harris acted as an agent and that the officer's "unrebutted testimony" supported the conviction. People v. Harris, 9 A.D.3d 334, 780 N.Y.S.2d 145, 146 (2004).[2] After unsuccessfully exhausting all New York State remedies available to him, Harris petitioned the district court *203 for a writ of habeas corpus under 28 U.S.C. § 2254. As noted, the district court granted the writ, setting aside the conviction on the ground that Harris was entitled under New York law to have the jury consider the agency defense to the charge of possession with intent to sell, and that, under standards clearly established by the rulings of the United States Supreme Court, the court's refusal to instruct the jury on the theory of his defense resulted in a conviction without due process of law. This appeal followed.

DISCUSSION
Under the standard of § 2254(d)(1) of the Antiterrorism and Effective Death Penalty Act of 1996 ("AEDPA"), a person convicted under state law is entitled to habeas corpus relief setting aside his conviction only if the state court's decision "was contrary to, or involved an unreasonable application of, clearly established Federal law, as determined by the Supreme Court of the United States."[3] "[A] federal habeas court making the `unreasonable application' inquiry should ask whether the state court's application of clearly established federal law was objectively unreasonable." Williams v. Taylor, 529 U.S. 362, 409, 120 S.Ct. 1495, 146 L.Ed.2d 389 (2000); see also Lockyer v. Andrade, 538 U.S. 63, 75-76, 123 S.Ct. 1166, 155 L.Ed.2d 144 (2003). "[T]o be `unreasonable,' the state court's application of federal law must reflect some increment of incorrectness beyond error, although that increment need not be great." Gersten v. Senkowski, 426 F.3d 588, 607 (2d Cir.2005) (citations and internal quotation marks omitted).
This appeal thus requires that we answer three questions: (1) whether as a matter of New York law Harris had a right to have the jury charged on the law establishing the agency theory of his defense; (2) whether the trial court's failure to instruct the jury on the agency defense "so infected the entire trial that [Harris's] resulting conviction violate[d] due process," Cupp v. Naughten, 414 U.S. 141, 147, 94 S.Ct. 396, 38 L.Ed.2d 368 (1973); and (3) whether the appellate court's subsequent affirmance of the conviction in spite of the trial court's refusal to instruct the jury on Harris's defense constituted an objectively unreasonable application of the Supreme Court's rulings on due process. See Davis v. Strack, 270 F.3d 111, 124 (2d Cir.2001). The district court answered these questions in the affirmative, and so do we.
1. The agency defense under New York law. Under the law of New York, in most circumstances, the unlawful sale of narcotics includes not only an exchange of drugs for money but any transfer of narcotics to another person, even gratuitous. Chong, 45 N.Y.2d at 72, 407 N.Y.S.2d 674, 379 N.E.2d 200. The purchase of narcotics, on the other hand, is punishable only as unlawful possession, and the criminal penalties for unlawful possession are substantially less onerous than the penalty for sale. Id. at 73, 407 N.Y.S.2d 674, 379 N.E.2d 200. New York courts have found incongruous the application of the conventional broad definition of sale to the situation where a defendant, acting upon the request of a would-be purchaser of drugs, acquires drugs for that person and delivers them, because to do so would result in the imposition of more severe penalties on the agent than on the principal, for whose benefit and at whose request the agent *204 acted, even if the agent performed the service as a favor without charge. See Id. at 73-74, 407 N.Y.S.2d 674, 379 N.E.2d 200. To remedy this incongruity, the New York courts have developed the "agency" defense to a charge of sale of contraband, or a charge of possession with intent to sell.
Under this defense, subject to certain exceptions and refinements,[4] contrary to the usual definition of sale, a defendant's transfer of drugs to another person is not punishable as a "sale" if the defendant undertook those actions "solely as the agent of the buyer." Id. at 73, 407 N.Y.S.2d 674, 379 N.E.2d 200. By the same token, a defendant's possession of narcotics with intent to transfer them to another is not punishable as possession with intent to sell, for which the penalties are more severe than for simple possession, if the defendant acquired the contraband acting solely as the agent of the intended recipient and did not intend to transfer them to any other person. In either case, the defendant could be convicted of, and punished for, unlawful possession, but not for sale or possession with intent to sell.
Nor is the benefit of the defense reserved for one who acts entirely without remuneration. According to somewhat confusing dicta in the Chong decision, a defendant's anticipation, or receipt, of "profit from the sale may be sufficient to establish his intent to sell," id. at 75, 407 N.Y.S.2d 674, 379 N.E.2d 200, and thus disqualify him from the benefits of the agency defense. However, this benefit is not forfeited merely because the purchaser-principal offers the defendant a share of the narcotics for consumption or "a tip or reimbursement for expenses as a token of friendship or appreciation for the favor." Id.
In reviewing a defendant's request for the agency charge, the trial court is "required to view the trial evidence in the light most favorable to the defendant and to give the instruction if `some evidence, however slight . . . support[s] the inference that the supposed agent was acting, in effect, as an extension of the buyer.'" People v. Ortiz, 76 N.Y.2d 446, 448, 560 N.Y.S.2d 186, 560 N.E.2d 162 (1990) (quoting People v. Argibay, 45 N.Y.2d 45, 55, 407 N.Y.S.2d 664, 379 N.E.2d 191 (1978) (per curiam)).
In the case before us, the evidence, if viewed in the light most favorable to the defendant, clearly showed entitlement to have the jury instructed on the agency defense. The defendant's grand jury testimony, which the People had offered in evidence, understood in the light most favorable to him, included his explanation that he had purchased the drugs found on him in part with his own money for his own use and in part as a favor for his prostitute friend, using her money, intending to meet with her later in a hotel to deliver (and presumably share) the drugs. His admission of having smoked 3 of the 20 packets he had purchased did not negate his entitlement to a charge on the agency defense for the following reasons. If these 3 packets are seen as purchased by him with his own money for his own use, it is clear he had no intention to sell *205 these 3 packets. See Andujas, 79 N.Y.2d at 118, 580 N.Y.S.2d 719, 588 N.E.2d 754. Even assuming, however, that the 3 packets he consumed were purchased with his friend's money and constituted a benefit she paid him for his agency service, and assuming further that they intended to share the consumption of the remainder when they met later that night, he was nonetheless entitled to a charge of the agency defense, according to Chong's express recognition (noted above) that the defense is available where the principal shares the drugs with the purchasing agent.
The Appellate Division, in affirming the trial judge's refusal to charge on the agency defense, stated, "Defendant offered no evidence to rebut" what the court described as the "unrebutted testimony" of the surveillance officer to the effect that from his rooftop observation point he had observed the defendant offering and selling what appeared to be drugs on the street. 780 N.Y.S.2d at 146-47. The court added, "There is no reasonable view of the evidence that supports the inference of agency." Id. at 147. In these observations, the court either failed to recognize the significance of the defendant's grand jury testimony attesting to his agency role, or failed to view the evidence in the light most favorable to the defendant in order to determine whether the defendant was entitled to an instruction on the theory of his defense. In the first place, the court was mistaken in considering the surveillance officer's testimony "unrebutted." The defendant's grand jury testimony included a denial of the conduct to which the police witness testified, and a statement that his having "sold this man something . . . is out of the question. I don't sell drugs out there no more."
In stating that there was no evidence to support the inference of agency, the court apparently refused to credit the defendant's grand jury testimony describing the agency relationship. Finally, in relying on the officer's testimony, which the court said was "indicative of a sale," rather than on the evidence which supported the agency defense, the court was viewing the evidence in the light most favorable to the People, rather than in the light most favorable to the defendant. Under the evidence most favorable to Harris, the agency defense applied. If the jury accepted his version of the facts, it could not properly find that he intended to sell. He was entitled under New York law to have the jury instructed on the law that supported his defense.
2. Due Process. The second question we must resolve is whether the failure to give the requested agency charge "so infected the entire trial that the resulting conviction violates due process." Cupp, 414 U.S. at 147, 94 S.Ct. 396. To assess the full impact of the trial court's failure to instruct the jury on the theory of Harris's defense, it is necessary to take into account how the case was presented to the jury. The trial judge instructed the jury to the effect that any transfer of drugs to another person would constitute a sale. The prosecutor accordingly argued in summation that, under that definition of sale, Harris's plan, which he had recited in his own grand jury testimony, to give the bags of drugs to his friend, the prostitute, would satisfy intent to sell. On the record of the trial, however, the jury could perfectly reasonably have doubted the accuracy of the officer's testimony about his observations from the rooftop and accepted the defendant's version that he was not selling drugs but had acquired the drugs found on him for his friend. Because of the court's charge to the effect that any transfer of narcotics is deemed a sale, coupled with the prosecutor's summation, if the jury believed Harris's testimony that he had *206 not offered or sold drugs on the street and that he had acquired the drugs found by the police in his possession solely as an agent doing a favor for his friend, intending to turn those drugs over to her later in the evening and share them with her, the jury would have been forced to conclude that Harris was guilty of the charge of possession with intent to sell, instead of acquitting him of possession with intent to sell. Viewed in context, the court's failure to instruct on the legal basis for his defense was "catastrophic." See Davis, 270 F.3d at 132. It converted a reasonable possibility of acquittal into a virtual directed verdict of conviction. We conclude that this error "so infected the entire trial that the resulting conviction violate[d] due process." Cupp, 414 U.S. at 147, 94 S.Ct. 396.
3. Unreasonable Application of Supreme Court Law. Our third inquiry, mandated by § 2254(d)(1), is whether the conviction or its affirmance in spite of the failure to instruct the jury on the law governing Harris's defense, was contrary to, or an unreasonable application of, Supreme Court law. Jackson v. Edwards, 404 F.3d 612, 621 (2d Cir.2005). Where a jury properly instructed under New York law could reasonably have concluded that Harris was not guilty of intent to sell, but was instead virtually compelled by the court's faulty instructions to find him guilty on the basis of the very facts that constituted his defense, we have no trouble concluding that not only was the deprivation of instructions explaining the law of the theory of his defense a denial of due process, but also that the state decisions upholding his conviction were egregiously at odds with the standards of due process propounded by the Supreme Court in Cupp. See Davis, 270 F.3d at 133. As in Davis, the failure to allow the jury to consider his defense resulted in an "open and shut" conviction. Id. at 131. The refusal to instruct the jury on agency, coupled with the instruction that any transfer constitutes a sale, had the effect of virtually directing a verdict against Harris when a reasonable view of the evidence under a proper charge might reasonably have resulted in an acquittal. The conclusion of the New York courts that this conviction comported with due process amounted to an unreasonable application of Supreme Court law.[5]
We have considered the state's other contentions and find them to be without merit.

CONCLUSION
For the foregoing reasons, we AFFIRM the judgment of the district court.
NOTES
[1]  Pursuant to Federal Rule of Appellate Procedure 43(c)(2), George B. Alexander, Chairman of the New York Department of Parole, and Andrew M. Cuomo, New York State Attorney General, are automatically substituted as respondents-appellants for Robert Dennison, former Chairman of the New York Department of Parole and for Eliot Spitzer, former New York State Attorney General.
[2]  Harris's application for leave to appeal to the New York State Court of Appeals was denied. He then moved unsuccessfully for writ of error coram nobis.
[3]  Under § 2254(d)(2), relief may also be granted if the affirmance of the conviction "was based on an unreasonable determination of the facts in light of the evidence presented in the State court proceeding."
[4]  As an example of an exception, a defendant's participation, even as an agent, in large scale profit-motivated dealings apparently would not qualify for the defense. In Chong, a transaction involving a pound and a half of heroin at $28,000 per pound, coupled with the defendant's discussions of arranging for the purchase and smuggling 50-100 pounds of heroin from the Far East, made clear that the defendant was acting with "clear intent to exploit the sale," which made him ineligible for the agency defense. See Chong, 45 N.Y.2d. at 76-77, 407 N.Y.S.2d 674, 379 N.E.2d 200.
[5]  Because the New York trial and appellate courts believed that the jury instructions as given were correct, they never explicitly discussed the question whether the conviction violated due process, much less the Supreme Court's Cupp opinion. The fact that the state court did not discuss any decision of the Supreme Court establishing federal law does not preclude a finding, upon a petition for habeas corpus, that the state court conviction and its affirmance constituted an unreasonable application of "clearly established Federal law, as determined by the Supreme Court." 28 U.S.C. § 2254(d)(1). See Davis, 270 F.3d 111. If the only reasonable application of clearly established Federal law, as determined by the Supreme Court, required overturning a state court conviction, the state court's affirmance of that conviction would be an unreasonable application of Federal law, as determined by the Supreme Court, even though the state court gave no consideration to the Supreme Court precedent.
