
630 F.3d 1239 (2011)
UNITED STATES of America, Plaintiff-Appellee,
v.
Javier Dolores GONZALEZ-DIAZ, Defendant-Appellant.
United States of America, Plaintiff-Appellee,
v.
Javier Dolores Gonzalez-Diaz, Defendant-Appellant.
Nos. 10-30002, 10-30030.
United States Court of Appeals, Ninth Circuit.
Argued and Submitted November 5, 2010.
Filed January 24, 2011.
*1240 Anthony R. Gallagher, Federal Defender, Federal Defenders of Montana, Great Falls, MT, for the defendant-appellant.
Michael W. Cotter, United States Attorney, Bryan R. Whittaker (argued), Assistant United States Attorney, Helena, MT, for the plaintiff-appellee.
Before: WILLIAM A. FLETCHER and RAYMOND C. FISHER, Circuit Judges, and JAMES P. JONES, District Judge.[*]

OPINION
FISHER, Circuit Judge:
Javier Dolores Gonzalez-Diaz appeals his conviction for being "found in" the United States following deportation, in violation of 8 U.S.C. § 1326. Gonzalez-Diaz was living in the United States unlawfully from April 2009 through June 19, 2009. On June 19, he drove into Canada. On the Canadian side of the border, Canadian immigration officers issued him a form permitting his entry for further examination, transported him 55 miles from one port of entry to another, held him overnight in a Canadian jail, questioned him regarding his immigration status the following morning, determined he was excludable, drove him back to the initial port of entry and handed him over to United States immigration authorities, who arrested him for violating § 1326. Gonzalez-Diaz contends that he was not "found in" the United States because his unlawful presence in the United States since April 2009 ended when he entered Canada on June 19, and because he was under official restraint when he re-entered the United States on June 20. We have jurisdiction under 28 U.S.C. § 1291 and we affirm.
In accordance with United States v. Ambriz-Ambriz, 586 F.3d 719 (9th Cir.2009), we hold that Gonzalez-Diaz's unlawful presence in the United States was not affected by his relatively brief physical presence in Canada because he was never "legally in" Canada. We also hold that Gonzalez-Diaz was not under official restraint *1241 when he was arrested by U.S. immigration agents because, having been denied legal entry into Canada, he was not entering the United States from a foreign country.[1]

BACKGROUND
In April 2009, Gonzalez-Diaz illegally entered the United States from Mexico near Douglas, Arizona. He traveled to Utah, where he met Phillip Baca, who assisted him in obtaining fraudulent identification documents. Gonzalez-Diaz then moved to Ronan, Montana, where he sought and obtained employment using the name, social security number and social security card of Baca and the fraudulent Utah identification card Baca had helped him obtain. On June 2, 2009, Gonzalez-Diaz applied for a United States passport, using Baca's name, social security number and birth certificate and representing himself to be a United States citizen.
On June 19, 2009, Gonzalez-Diaz drove his car from Montana, crossed the international boundary and presented himself to Canadian immigration officers for entry to Canada at the Chief Mountain, Alberta port of entry. At the border, Gonzalez-Diaz produced a Utah identification card to a Canadian Border Services Agency officer. Because Gonzalez-Diaz claimed to be a U.S. citizen but did not provide proof of citizenship, border services officers conducted a secondary immigration exam. They searched the car and found numerous identification documents, some in Baca's name and some in Gonzalez-Diaz's name. Based on the conflicting documents and the absence of proof of citizenship, the officers determined that Gonzalez-Diaz could not be admitted to Canada. They planned to prepare an "Allowed to Leave" form, denoting that Gonzalez-Diaz did not have proper forms of identification to enter Canada, so he could return to the United States.
Gonzalez-Diaz, however, refused to return to the United States. He told the Canadian officers that he would die in prison if he went back to the United States and that a drug cartel would kill him if he went back to Mexico. One of the inspecting officers interpreted Gonzalez-Diaz's statements as a potential refugee claim. Because the Chief Mountain port of entry was not equipped with personnel or equipment to handle Gonzalez-Diaz's case, the officers completed an "Entry for Further Examination" form and transported him to the Carway port of entry, about 55 miles away, under a Royal Canadian Mounted Police escort.
When Gonzalez-Diaz and the officers arrived in Carway, it was too late in the day to process his case, so the officers took him to the Royal Canadian Mounted Police lockup in Cardston for the night, approximately 15 miles away.
The next morning, June 20, Canadian officers transported Gonzalez-Diaz from the jail back to the Carway point of entry, where he was interviewed and found to be inadmissible because he lacked a passport. The officers issued an exclusion order. They then drove Gonzalez-Diaz to the United States border and released him into U.S. custody at the Chief Mountain port of entry, known as the Piegan, Montana port of entry on the United States side of the border. Gonzalez-Diaz was in some form of custody the entire time he was in Canada.
At the Piegan port of entry, United States Customs and Border Protection agents ran Gonzalez-Diaz's information *1242 through several records checks, which showed he was a native and citizen of Mexico and had been previously deported from the United States on four occasions. Agents also interviewed Gonzalez-Diaz, who admitted that he was a citizen of Mexico and was in the United States illegally.
Gonzalez-Diaz was indicted on eight counts, including, as relevant here, one count of being found in the United States following deportation, in violation of 8 U.S.C. § 1326. The case was tried to a jury over two days. At the close of the government's case, Gonzalez-Diaz moved for judgment of acquittal under Rule 29 of the Federal Rules of Criminal Procedure, arguing that he was not "found in" the United States when he was apprehended at the border by U.S. immigration agents because he was entering the United States from Canada. The district court denied the motion, concluding that Gonzalez-Diaz was "found in" the United States because he had never been admitted into Canada. Gonzalez-Diaz was convicted on all counts, and now appeals.

STANDARD OF REVIEW
We review de novo the denial of a Rule 29 motion for acquittal. See United States v. Rocha, 598 F.3d 1144, 1153 (9th Cir.2010). The test to be applied is the same as for a challenge to the sufficiency of the evidence. See id. "First, a reviewing court must consider the evidence presented at trial in the light most favorable to the prosecution." United States v. Nevils, 598 F.3d 1158, 1164 (9th Cir.2010) (en banc). Second, "the reviewing court must determine whether this evidence, so viewed, is adequate to allow `any rational trier of fact [to find] the essential elements of the crime beyond a reasonable doubt.'" Id. (quoting Jackson v. Virginia, 443 U.S. 307, 319, 99 S.Ct. 2781, 61 L.Ed.2d 560 (1979)).

DISCUSSION
"Section 1326 criminalizes three acts by aliens who have been deported: (1) entering the United States; (2) attempting to enter; or (3) being `found in' the United States, all without permission of the Attorney General." United States v. Hernandez, 189 F.3d 785, 789 (9th Cir.1999).[2] Here, the indictment charged Gonzalez-Diaz only under the third theorywith being found in the United States, following deportations in 1999, 2003 and 2008.
Gonzalez-Diaz concedes he was found by U.S. immigration authorities when they identified him and determined his unlawful status at the Piegan port of entry on June 20. See id. at 791 ("The offense of being found in the United States ends when an alien is discovered and identified by the immigration authorities."). But he denies he was found in the United States, arguing that he was not present in the United States when he was found. He contends his presence in the United States since *1243 April 2009 ended when he departed the United States and entered Canada on June 19 and 20. He further contends that even though he was physically present within the United States on June 20, when he was apprehended by U.S. immigration authorities at the Piegan port of entry, he was not in the United States at that time for purposes of § 1326 because he was not free from official restraint.
Gonzalez-Diaz's argument rests on two sound general propositions. First, an alien cannot be found in the United States if he has departed the United States before he is found. This is so because the offense of being found in the United States requires both the alien's unlawful presence and his discovery by immigration authorities: if an alien departs the United States before his unlawful presence is discovered, the offense has not been committed. See United States v. Ayala, 35 F.3d 423, 425 (9th Cir. 1994) ("To avoid being `found in' the United States, a deported alien can either not re-enter the United States or, if he has already re-entered the United States, he can leave."); see also Hernandez, 189 F.3d at 790 (explaining that § 1326 makes it a crime "for a deported alien to remain in the United States until he is `found' by the authorities"). Second, when an alien is entering the United States from a foreign country and is discovered at the border, he cannot be found in the United States until he is free from official restraint. See United States v. Ruiz-Lopez, 234 F.3d 445, 448 (9th Cir.2000) ("An alien's mere physical presence on United States soil ... is insufficient to convict him of being found in the United States.... Rather, the government must also establish that the alien entered the United States free from official restraint at the time officials discovered or apprehended him.").
As applied here, however, Gonzalez-Diaz's argument is without merit because he neither departed the United States nor entered Canada in the sense contemplated by the aforementioned authorities. Our conclusion is dictated by United States v. Ambriz-Ambriz, 586 F.3d 719 (9th Cir. 2009), which we decided shortly after Gonzalez-Diaz's trial. Ambriz was a citizen of Mexico who, like Gonzalez-Diaz, had been in the United States illegally for some time before attempting to leave the United States by driving to Canada. See id. at 721, 723. The vehicle in which he was traveling with two other individuals crossed onto Canadian soil but was denied entry into Canada and forced to proceed back to the United States port of entry, where U.S. immigration agents stopped the vehicle, discovered that Ambriz was in the United States unlawfully and arrested him. See id. at 721. Like Gonzalez-Diaz, Ambriz was convicted of being found in the United States following deportation in violation of § 1326. On appeal, he argued that he was not found in the United States because he was under official restraint when he was apprehended at the U.S. border. See id. at 722.
We rejected Ambriz's argument, explaining that the official restraint doctrine "pertains to an individual entering the United States from a foreign country, and thus is inapplicable to Mr. Ambriz's situation." Id. at 723. "Although Ambriz may have technically traveled onto Canadian land from the United States, he was never legally in Canada, and thus, when he appeared at the port of entry, he was not entering the United States from a foreign country." Id. We held that "there was more than enough evidence from which a juror could reasonably conclude that Ambriz was not entering the United States from Canada and thus was `found in' the United States for purposes of § 1326," based on Ambriz's unlawful presence in the United States before his attempted entry into Canada Id. at 724. The official *1244 restraint doctrine was inapplicable because he did not succeed in his attempt to enter Canada, and therefore "Ambriz never legally left the United States." Id.
Gonzalez-Diaz would distinguish Ambriz-Ambriz by emphasizing the factual differences between that case and his own. He points out that Canadian authorities summarily denied Ambriz entry at the border, whereas he was issued an Entry for Further Examination form, spent parts of two days in Canada, traveled beyond the Chief Mountain point of entry to Carway and Cardston and was questioned extensively by Canadian immigration authorities before being turned away. Focusing on the Entry for Further Examination form, he argues that he gained legal entry into Canada, unlike Ambriz, and therefore should be deemed to have entered Canada and departed from the United States. Having thus ended his unlawful presence in the United States, he argues, he must necessarily have reentered from a foreign country, such that the official restraint doctrine is applicable.
These factual distinctions are immaterial. The Canadian border services officers involved in Gonzalez-Diaz's detention uniformly testified that he never gained legal entry into Canada.[3] The Entry for Further Examination form states that "[t]his authorization to enter Canada does not confer status." Canadian immigration officers testified that the sole reason for issuing this form was to be able to transport Gonzalez-Diaz from Chief Mountain to Carway for further questioning. One officer testified:
Because he was not legally admitted to Canada, we have a form that furthers the examination. And it's essentially the same as walking to another building within the same port in terms of legal ramifications. We filled out this form which means that he still had not been legally admitted to Canada, even though he was physically in the country. And that form allowed us to take him to the Port of Carway without legally admitting him.
Gonzalez-Diaz was never "legally in" Canada and was in some form of custody throughout his physical presence there. He therefore remained "in" the United States until June 20, when he was "found" by U.S. immigration authorities. Because he was not entering the United States from a foreign country on June 20, the official restraint doctrine does not apply. See Ambriz-Ambriz, 586 F.3d at 723-24. The district court therefore properly denied his motion for acquittal.
AFFIRMED.
NOTES
[*]  The Honorable James P. Jones, United States District Judge for the Western District of Virginia, sitting by designation.
[1]  We address other issues Gonzalez-Diaz raises on appeal in a concurrently filed memorandum disposition.
[2]  Section 1326(a) provides:

Subject to subsection (b) of this section, any alien who
(1) has been denied admission, excluded, deported, or removed or has departed the United States while an order of exclusion, deportation, or removal is outstanding, and thereafter
(2) enters, attempts to enter, or is at any time found in, the United States, unless (A) prior to his reembarkation at a place outside the United States or his application for admission from foreign contiguous territory, the Attorney General has expressly consented to such alien's reapplying for admission; or (B) with respect to an alien previously denied admission and removed, unless such alien shall establish that he was not required to obtain such advance consent under this chapter or any prior Act,
shall be fined under Title 18, or imprisoned not more than 2 years, or both.
8 U.S.C. § 1326(a).
[3]  The opinions of Canadian Border Services Agency officers are not conclusive on questions of Canadian immigration law. We nonetheless conclude that by presenting the officers' testimony, which is consistent with the language of the Entry for Further Examination form itself, the prosecution here satisfied its burden at trial of establishing that Gonzalez-Diaz did not gain legal entry into Canada within the meaning of Ambriz-Ambriz. The parties have not provided any Canadian legal authority to the contrary and we are not aware of any. Cf. Leng May Ma v. Barber, 357 U.S. 185, 188, 78 S.Ct. 1072, 2 L.Ed.2d 1246 (1958) (applying U.S. law) ("[T]he detention of an alien in custody pending determination of his admissibility does not legally constitute an entry though the alien is physically within the United States.").
