
522 F.3d 983 (2008)
UNITED STATES of America, Plaintiff-Appellee,
v.
Juan Donaldo PERDOMO-ESPANA, Defendant-Appellant.
No. 07-50232.
United States Court of Appeals, Ninth Circuit.
Submitted March 5, 2008.[*]
Filed April 14, 2008.
*984 Elizabeth A. Missakian, San Diego, CA, for the defendant-appellant.
Karen P. Hewitt, United States Attorney, Bruce R. Castetter, Assistant U.S. Attorney, Chief, Appellate Section, Criminal Division, and Steven De Salvo, Assistant U.S. Attorney, San Diego, CA, for the plaintiff-appellee.
Before: KIM McLANE WARDLAW, RONALD M. GOULD, and SANDRA S. IKUTA, Circuit Judges.
GOULD, Circuit Judge:
Juan Perdomo-Espana ("Perdomo") appeals his jury conviction for one count of illegal entry into the United States as a deported alien in violation of 8 U.S.C. § 1326. In this opinion, we consider whether the defense of necessity that Perdomo advanced must be tested under an objective or subjective standard. We have jurisdiction pursuant to 28 U.S.C. § 1291. Determining that the necessity defense requires an objective analysis, we affirm the district court's denial of Perdomo's request for a jury instruction on the defense of necessity.

I
In the early morning hours of March 21, 2006, a United States border patrol officer found Perdomo and four others hiding in brush near the United States-Mexican border. Perdomo was wearing dark clothes. Upon discovery, Perdomo admitted that he is a Mexican citizen with no documents to allow him to enter or to remain in the United States. He was found with $598 (USD) and 155 Mexican pesos on his person. Perdomo was arrested and taken to a nearby border patrol station, where he was questioned and fingerprinted.[1] Immigration records revealed that he had twice previously been deported and had not subsequently applied for reentry.
*985 At trial, Perdomo testified that he had illegally entered the United States for fear of his life. Perdomo stated that in 2000, while in a United States federal prison, he had a stroke precipitated by a high blood sugar level associated with Type 2 diabetes, and thereafter he was treated with insulin injections. Upon his release from prison, Perdomo was given a small insulin supply and was removed to Mexico on March 7, 2006, where his insulin supply soon ran out. While in Tijuana, Perdomo purchased varying kinds of replenishing insulin, but none of the insulin was sufficiently effective, and his blood sugar level began to rise.
According to Perdomo, shortly before the border patrol caught him, he tried to enter the United States via the pedestrian lane at a nearby port of entry, but was turned away despite telling the officers of his need for diabetic-related treatment.[2] Perdomo claims that his blood sugar level soon thereafter rose to 480, the level it had reached when he suffered his diabetes-induced stroke. Perdomo asserted that he then attempted to cross clandestinely into the United States.
Perdomo testified that he entered the United States fearing for his life because of his high blood sugar levels, and did not intend to remain. He believed he was in desperate need of medical treatment which was unavailable in Mexico. Perdomo testified that he did not go to any hospital, church, or the police in Tijuana because he believed that he would not be able to secure the needed treatment in Tijuana, despite the money he carried. According to Perdomo, a person had to be dying on the street to gain medical attention there.
During questioning that took place about four to five hours after his initial capture, Perdomo told a border patrol agent for the first time that he is a Type 2 diabetic and that he had been hospitalized for two weeks in the last six months because of his diabetes. Perdomo displayed no cuts, bruising, shaking, tremors, excessive sweatiness, signs of malnourishment, or apparent strange behavior. However, when questioned whether he now or in the past had experienced weakness, significant weight loss, and fear of losing his mind, Perdomo responded affirmatively.
After questioning, Perdomo was taken to an emergency room, where his blood sugar level was recorded as 340. The emergency room physician who treated Perdomo, Dr. Vincent Knauf, characterized this glucose level as a "severe elevation." However, Dr. Knauf concluded that, in his opinion, Perdomo was not facing serious or imminent risk of bodily harm at that time; although he needed longer-term care, Perdomo was classified as a "non-urgent" patient.
Perdomo attributed the drop in blood sugar levels from his alleged earlier measure of 480 to the food he had eaten at the border patrol station, suggesting that it had been his experience that eating food causes his blood sugar level to decrease. However, Dr. Knauf indicated that he saw nothing to support Perdomo's claim that his blood sugar levels had recently been as high as 480; on the contrary, Dr. Knauf explained, he was not familiar with any foods that would cause blood sugar levels to go down, rather only some foods that would not precipitate as great an increase as others. He also offered that there are various forms of insulin, all of which will cause some response in their recipients, though of varying degrees of sufficiency. Moreover, intravenous injection of saline solution provides the "quickest reduction *986 of the blood sugar level[,] far quicker than insulin does." Dr. Knauf testified that it was his impression that someone with $600, in Perdomo's alleged condition the night he was caught by border patrol, would be able to visit a clinic in Tijuana for effective medical treatment.
During pre-trial hearings, Perdomo requested to present a necessity defense, which the government moved to preclude. Reserving its final ruling until after the presentation of evidence at trial, the district court allowed Perdomo to testify before the jury about why he had entered the country.
At the conclusion of evidence, Perdomo again requested that the jury be instructed on his proffered defense of necessity. The district court declined to give the requested instruction, reasoning that Perdomo showed no "threat of imminent harm," and that it was "incredulous to suggest that Mexico doesn't have clinics, doctors, [or] hospitals, that could manage people who are in need of treatment," especially given that Perdomo "had $600 on him at the time." The district court, instead, instructed the jury that the "theory of the defense" was that Perdomo had come to the United States for medical care. After the jury found Perdomo guilty, Perdomo moved for a new trial, which the district court denied. Perdomo appeals the district court's denial of his request for a necessity defense jury instruction.

II
Although the parties dispute the proper standard for reviewing the district court's decision to exclude Perdomo's proffered jury instruction, our case law is clear on this point: When reviewing a district court's denial of a defendant's requested jury instruction, the standard of review we use depends on the specific issue we are reviewing, and "reflect[s] the relative competencies and functions of the appellate and district courts." See United States v. Heredia, 483 F.3d 913, 921 (9th Cir.2007) (en banc). When the parties dispute the sufficiency of a proposed jury instruction's factual foundation, we review for abuse of discretion. See United States v. Daane, 475 F.3d 1114, 1119 (9th Cir.2007); United States v. Hairston, 64 F.3d 491, 493 (9th Cir.1995). However, when the parties dispute a legal determination by the trial court, we review de novo. See United States v. Batterjee, 361 F.3d 1210, 1216 (9th Cir.2004); United States v. Wiseman, 274 F.3d 1235, 1240 (9th Cir.2001); Hairston, 64 F.3d at 493. Hence, we review de novo the legal question whether the necessity defense requires an objective inquiry. Once we have resolved that legal question, we review for abuse of discretion whether there is a sufficient factual basis for Perdomo's proffered jury instruction.[3]

III
A defendant is entitled to have the jury instructed on his or her theory of *987 defense, as long as that theory has support in the law and some foundation in the evidence. United States v. Mason, 902 F.2d 1434, 1438 (9th Cir.1990). A defendant "has the right to have a jury resolve disputed factual issues. However, where the evidence, even if believed, does not establish all of the elements of a defense,... the trial judge need not submit the defense to the jury." United States v. Arellano-Rivera, 244 F.3d 1119, 1125 (9th Cir.2001) (internal quotation marks and alteration omitted), see also United States v. Lopez, 885 F.2d 1428, 1433 n. 5 (9th Cir. 1989), overruled on other grounds by Schmuck v. United States, 489 U.S. 705, 109 S.Ct. 1443, 103 L.Ed.2d 734 (1989) ("[It] is well established that a criminal defendant is entitled to have a jury instruction on any defense which provides a legal defense to the charge against him and which has some foundation in the evidence, even though the evidence may be weak, insufficient, inconsistent, or of doubtful credibility. In the necessity context, the proper inquiry is whether the evidence offered by a defendant, if taken as true, is sufficient as a matter of law to support the defense." (internal citations and quotation marks omitted)).
"[T]he defense of necessity, or choice of evils, traditionally covered the situation where physical forces beyond [an] actor's control rendered illegal conduct the lesser of two evils." United States v. Bailey, 444 U.S. 394, 410, 100 S.Ct. 624, 62 L.Ed.2d 575 (1980). In recent years, our case law has expanded the scope of the defense. We have held that a defendant may present a defense of necessity to the jury as long as the defendant "establish[es] that a reasonable jury could conclude: (1) that he was faced with a choice of evils and chose the lesser evil; (2) that he acted to prevent imminent harm; (3) that he reasonably anticipated a causal relation between his conduct and the harm to be avoided; and (4) that there were no other legal alternatives to violating the law." Arellano-Rivera, 244 F.3d at 1125-26 (internal quotation marks omitted). A defendant must prove each of these elements to present a viable necessity defense. See id.
Perdomo's principal argument is that these elements require a subjective analysis and that the relevant inquiry is thus into his state of mind  i.e., his allegedly genuine fear of the likely, dire medical consequences that he would have faced if he did not illegally reenter the United States. By contrast, the government asserts that the inquiry is an objective one. We agree with the government.
A careful reading of our cases on the subject reveals that we assess a defendant's proffered necessity defense through an objective framework. In United States v. Schoon, 971 F.2d 193 (9th Cir.1992), we applied an objective standard in assessing the fourth element of a necessity defense. See id. at 198. We stated that "the law implies a reasonableness requirement in judging whether legal alternatives exist." Id. Moreover, Arellano-Rivera reiterated our definition of the third element of a necessity defense as including a reasonableness requirement: The defendant must "reasonably anticipate[ ] a causal relation between his conduct and the harm to be avoided." Arellano-Rivera, 244 F.3d at 1126 (emphasis added).
In United States v. Simpson, 460 F.2d 515 (9th Cir.1972), moreover, while discussing justification defenses more broadly, we said:
The theoretical basis of the justification defenses is the proposition that, in many instances, society benefits when one acts to prevent another from intentionally or negligently causing injury to people or property. That benefit is lost, however, and the theory fails when the person *988 seeking to avert the anticipated harm does not act reasonably.
Id. at 517-18. Embedded in our recognition that a person who seeks to benefit from a justification defense must act reasonably is the principle that justification defenses necessarily must be analyzed objectively.
Schoon echoed this principle: "Necessity is, essentially, a utilitarian defense. It therefore justifies criminal acts taken to avert a greater harm, maximizing social welfare by allowing a crime to be committed where the social benefits of the crime outweigh the social costs of failing to commit the crime." Schoon, 971 F.2d at 196 (internal citation omitted). We continued: "The law could not function were people allowed to rely on their subjective beliefs and value judgments in determining which harms justified the taking of criminal action." Id. at 197. The latter statement follows logically from the former statement; after all, if the necessity defense were entirely subjective, then allowing a defendant to benefit from it would only advance the common good when the defendant's subjective beliefs were in alignment with an objective perspective.
More recently in Arellano-Rivera, we upheld the district court's preclusion of a defendant's proffered necessity defense, reasoning that the defendant had failed to show that he had no legal alternatives other than illegally reentering the United States. Arellano-Rivera, 244 F.3d at 1126. We denied the defendant's appeal, notwithstanding his speculation that the Attorney General would have denied the defendant's application for reentry based on his advanced medical condition; the defendant's subjective belief that this legal alternative was unavailable to him was insufficient to sustain his necessity defense. Id.; see also United States v. Dorrell, 758 F.2d 427, 431 (9th Cir.1985) (concluding that the defendant is not entitled to present the defense of necessity because the evidence, even if believed, could not establish that the defendant "reasonably anticipated" that his criminal conduct would avert the harm he sought to avoid).
We therefore hold that the test for entitlement to a defense of necessity is objective. The defendant must establish that a reasonable jury could conclude that (1) he was faced with a choice of evils and reasonably chose the lesser evil; (2) he reasonably acted to prevent imminent harm; (3) he reasonably anticipated a causal relation between his conduct and the harm to be avoided; and (4) he reasonably believed there were no other legal alternatives to violating the law. See Arellano-Rivera, 244 F.3d at 1125-26; Schoon, 971 F.2d at 195; Dorrell, 758 F.2d at 430-31. It is not enough, as Perdomo argues, that the defendant had a subjective but unreasonable belief as to each of these elements. Instead, the defendant's belief must be reasonable, as judged from an objective point of view.

IV
Applying an objective standard to Perdomo's case, his argument that he was entitled to a jury instruction on the necessity defense fails on several bases. Dr. Knauf concluded that Perdomo was in no immediately dire medical condition when he was treated in the emergency room soon after crossing the border; thus Perdomo's crossing was not averting any objective, imminent harm, causing his defense to fail on the second element. Additionally, Dr. Knauf testified that there are multiple clinics in Tijuana where Perdomo could have obtained medical treatment, particularly with the money he had, and that, even assuming that his medical condition had been dire, a saline injection would have been the fastest effective means of bringing Perdomo's *989 condition under control; thus there objectively were legal alternatives to violating the law, causing Perdomo's defense to fail on the fourth prong. Moreover, from an objective perspective, Perdomo's tactic of hiding in bushes, in dark clothing, and in a remote area, trying to escape border patrol's detection, likely thwarted rather than advanced the speedy receipt of medical treatment, meaning that the defense fails on the third prong as well.
Failure on any one of these three bases, let alone all three, was sufficient to support the district court's determination that Perdomo did not present adequate evidence to establish a prima facie case of the necessity defense. Our case law is clear that a trial judge may decline to allow evidence of a necessity defense where the defendant fails to present a prima facie case. See, e.g., Arellano-Rivera, 244 F.3d at 1125 ("Where the evidence, even if believed, does not establish all of the elements of a defense, ... the trial judge need not submit the defense to the jury." (internal quotation marks and alteration omitted)); see also United States v. Cervantes-Flores, 421 F.3d 825, 828-29 (9th Cir.2005), cert. denied, 547 U.S. 1114, 126 S.Ct. 1911, 164 L.Ed.2d 668 (2006). All the more so, then, a trial court may preclude a jury instruction after having heard evidence at trial that collectively presents an insufficient factual foundation to establish the defense as a matter of law.
Perdomo was not entitled to a jury instruction regarding necessity in this case because the defense lacked a necessary foundation in evidence. Even if Perdomo's testimony were believed, he did not establish all of the elements of the defense of necessity. See United States v. Yarbrough, 852 F.2d 1522, 1541 (9th Cir.1988). The district court properly analyzed Perdomo's case under an objective framework and did not abuse its discretion when it denied Perdomo's requested jury instruction.
AFFIRMED.
NOTES
[*]  The panel unanimously finds this case suitable for decision without oral argument. See Fed. R.App. P. 34(a)(2).
[1]  Although a foreign substance on his fingers obscured the prints, subsequent fingerprints confirmed Perdomo's identity, showing a match to fingerprints retrieved when Perdomo had previously been deported. A forensics expert testified at trial to her opinion that a foreign substance such as Crazy Glue had obscured the fingerprints. Perdomo denied putting anything on his fingers to obscure his prints.
[2]  A border patrol custodian of records did not find any record of this alleged attempt to cross the border at the pedestrian lane.
[3]  Perdomo cites United States v. Schoon, 971 F.2d 193, 195 (9th Cir. 1992) for the proposition that we review de novo a district court's decision to bar a necessity defense. Schoon holds that we review de novo the question whether a "defendant's offer of proof[ ] is insufficient as a matter of law to support the proffered defense." Id. (internal quotation marks omitted); see also United States v. Cervantes-Flores, 421 F.3d 825, 828 (9th Cir. 2005), cert. denied, 547 U.S. 1114, 126 S.Ct. 1911, 164 L.Ed.2d 668 (2006); United States v. Arellano-Rivera, 244 F.3d 1119, 1125-26 (9th Cir.2001). However, that principle is of limited relevance here; in those cases, the trial court precluded the defendant from presenting evidence in support of a necessity defense. In this case, the district court allowed the evidence to be presented to the jury, but not the corresponding jury instruction that Perdomo had requested.
