
    Gilberto Ivan RAMIREZ, Plaintiff-Appellant, v. FIELD OFFICE DIRECTOR, U.S. Citizenship & Immigration Services, West Palm Beach Field Office, Anouchka Castro, U.S. Attorney General, Secretary, U.S. Department of Homeland Security, Defendants-Appellees.
    No. 16-10535 Non-Argument Calendar
    United States Court of Appeals, Eleventh Circuit.
    Date Filed: 12/19/2016
    
      Eduardo Rigoberto Soto, Eduardo Soto & Associates, Coral Gables, FL, for Plaintiff-Appellant
    Theo Nickerson, U.S. Department of Justice, Civil Division, Office of Immigration Litigation, Washington, DC, Jessica Elise Elliott, Wifredo A- Ferrer, Emily M. Smachetti, U.S. Attorney’s Office, Miami, FL, for Defendants-Appellees
    Before MARCUS, WILLIAM PRYOR and FAY, Circuit Judges.
   PER CURIAM:

Gilberto Ivan Ramirez appeals the dismissal of his petition for review of the denial of his application for naturalization. He contends that the district court erred when it ruled that the date of his conviction for an aggravated felony rendered him permanently ineligible for naturalization. We affirm.

We review de novo a dismissal for failure to state a claim upon which relief may be granted. Leib v. Hillsborough Cnty. Pub. Transp. Comm’n, 558 F.3d 1301, 1305 (11th Cir. 2009).

To become a naturalized citizen, an applicant must establish and maintain “good moral character” while residing in the United States. 8 U.S.C. § 1427(a). An applicant cannot establish good moral character if he was convicted of an aggravated felony on or after November 29, 1990. 8 C.F.R. § 316.10(b)(l)(ii). Aggravated felonies include drug trafficking crimes. 8 U.S.C. § 1101(a)(43)(B). A conviction can be “a formal judgment of guilt, of the alien entered by a court.” Id. § 1101(a)(48)(A). And “if adjudication of guilt has been withheld,” a conviction occurs when “(i) a judge or jury has found the alien guilty or the alien has entered a plea of guilty ... and (ii) the judge has ordered some, form of punishment, penalty, or restraint on the alien’s liberty to be imposed.” Id. § 1101(a)(48)(A)(i)-(ii).

The district court correctly concluded that Ramirez’s conviction for possession with intent to distribute at least five kilograms of cocaine occurred after November 29, 1990. Ramirez was not convicted until the district court accepted his plea, adjudicated his guilt, imposed his sentence, and entered its judgment in January 1991. Mejia Rodrigues v. Dep’t of Homeland Sec., 629 F.3d 1223, 1226 (11th Cir. 2011). The detention order entered in June 1989 was not a punishment because it was unrelated to Ramirez’s guilt or innocence. The district court determined that Ramirez was a flight risk and a danger to the community and ordered him detained pending the outcome of his criminal case. We affirm.

AFFIRMED.  