These rules govern a petition for a writ of habeas corpus filed. 2 in a United States district court under 28 U.S.C. § 2254 by: 3.First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison. A federal petition for habeas corpus is filed after a conviction and sentence in state court, and after appeals in state court. Friend filed a habeas corpus petition in this court, which we denied in 2015. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. On September 14, 2010, Petitioner executed his federal application for a Writ of Habeas Corpus pursuant to 28 U.S.C. § 2254. (Doc. 1 at 27.) DISCUSSION. District of the Federal Court and did not file a reply in the Eighth Circuit. It was at this point that Cross filed the instant petition for habeas corpus in the federal district court in New Hampshire.