
72 Wis.2d 327 (1976)
240 N.W.2d 635
STATE, Respondent,
v.
THEOHAROPOULOS, Appellant.
No. State 79 (1974).
Supreme Court of Wisconsin.
Argued February 3, 1976.
Decided April 20, 1976.
*329 For the appellant there was a brief by James A. Walrath and Shellow & Shellow of Milwaukee, and a reply brief by James R. Glover and Shellow & Shellow of Milwaukee, and oral argument by Mr. Glover.
For the respondent the cause was argued by Michael R. Klos, assistant attorney general, with whom on the brief was Bronson C. La Follette, attorney general.
HEFFERNAN, J.
This is an appeal from an order denying defendant's motion for postconviction relief pursuant to sec. 974.06, Stats., entered on February 15, 1974. The defendant sought to have his conviction of February 18, 1969, for the sale of marijuana for smoking purposes, set aside. At the time the defendant filed his petition for relief, he had been discharged from supervision and custody as the result of the 1969 conviction and was not, as is required by sec. 974.06 (1), "in custody under sentence of a court." As a consequence, the trial court was without jurisdiction, and this court is required to vacate the order and remand to the trial court with directions to dismiss the petition.
The facts show that, following the defendant's conviction on February 18, 1969, his sentence was stayed and he was placed on probation for a period of two years. On February 17, 1971, the sentencing court entered an order discharging him from probation supervision and discharging him from further sanctions in respect to the case.
In 1973, the defendant filed a petition for postconviction relief under sec. 974.06, Stats., on the grounds that he had been improperly convicted, basically for the reason that the marijuana statute under which he was charged *330 was unconstitutionally vague, and also because of alleged prejudicial errors committed during the course of trial.
In his petition for postconviction relief, he alleged that he was then confined in the Waukesha County Jail under a federal detainer for possible deportation from the United States and that such custody and possible deportation was the result of his previous conviction in the state courts in 1969.
Section 974.06, Stats., in the portion pertinent to this appeal, provides:
"974.06 Post-conviction procedure. (1) A prisoner in custody under sentence of a court claiming the right to be released upon the ground that the sentence was imposed in violation of the U. S. constitution or the constitution or laws of this state, that the court was without jurisdiction to impose such sentence, or that the sentence was in excess of the maximum authorized by law or is otherwise subject to collateral attack, may move the court which imposed the sentence to vacate, set aside or correct the sentence."
The jurisdictional question was not argued in the circuit court, but it was raised by the state on appeal. Defendant's counsel also submitted a complete brief on the jurisdictional question. Because the question is one of subject-matter jurisdiction and because both parties have presented their views in extenso, it is appropriate and necessary that the question be decided.
The facts are undisputed that, at the time of the filling of the motion for postconviction relief, the defendant was no longer under sentence, nor in custody under the sentence of the state court. On the face of it, therefore, it appears indisputable that the circuit court had no jurisdiction to entertain the petition for relief.
The defendant argues, however, that the jurisdictional requirement is satisfied, because the petition alleged that the defendant was confined in the Waukesha County Jail and that the conviction in the state court was the basis *331 for the federal detainer and for the possible deportation proceedings. He argues that, because there is admittedly a causal relationship between the 1969 conviction and the federal detention, the custody requirement is satisfied. The defendant urges that, under the cases decided pursuant to the federal postconviction statute, 28 U.S. Code, sec. 2255, of which sec. 974.06, Stats., is almost a carbon copy, a liberal construction should be given to the custody requirement.
While we agree with the defendant's premises that the custody requirement should be interpreted with liberality, an examination of the federal cases discussing the custody requirements under 28 U. S. Code, secs. 2241 and 2255, support not the defendant's position, but the state's.
The federal courts uniformly hold that a detainer constitutes custody for purposes of 28 U. S. Code, secs. 2241 and 2255. Word v. North Carolina (4th Cir. 1969), 406 Fed. 2d 352; Desmond v. United States Board of Parole (1st Cir. 1968), 397 Fed. 2d 386; Dodd v. United States Marshal (2d Cir. 1971), 439 Fed. 2d 774; and U. S. ex rel. Meadows v. State of New York (2d Cir. 1970), 426 Fed. 2d 1176. These cases make it clear that custody under a detainer is attributable to the governmental entity which has lodged the detainer.
The jurisdiction over the defendant was obtained by a federal detainer warrant, and the custody of the defendant in the Waukesha County Jail is by the United States Government. The fact that the defendant at the time of the filing of the petition was physically within the confines of the Waukesha County Jail should not confuse the question, for that facility has contracted with the United States Department of Justice for the housing of federal prisoners, and legal custody vests in the United States and not in the state of Wisconsin.
The custody is not "under sentence of a court." The custody is the result of a separate process, completely beyond the control of the state of Wisconsin.
*332 The defendant, however, argues that several cases which have been decided in the federal system have permitted a defendant to attack a sentence already served. While the fact that the sentence attacked has been completely served will not necessarily preclude a sec. 2241 or 2255 challenge to the conviction, the conditions which permit such an attack are not present in this case.
The federal courts have noted that a defendant who wishes to challenge a sentence already served faces two hurdlesmootness and jurisdictionbefore the court will proceed to a decision. Carafas v. LaVallee (1968), 391 U. S. 234, 88 Sup. Ct. 1556, 20 L. Ed. 2d 554; Thomas v. Tansey (D. C. Md. 1972), 359 Fed. Supp. 441. Mootness and jurisdiction are separate issues, and both must be overcome by a convicted person seeking relief under a statutory postconviction remedy.
The defendant relies upon Banks v. United States (S. D. N. Y. 1970), 319 Fed. Supp. 649. In that case, the petitioner was serving a sentence under a recidivist statute and wished to attack the conviction on the sentence which he had already served. The court held that, under those circumstances, the prior conviction could be reached under sec. 2255 because the case was not mooted by the expiration of the first sentencethe defendant was still suffering the collateral consequences of the previous conviction. The court concluded it had jurisdiction because of the close causal relationship between the sentence being served and the expired sentence. The court held in Banks that the defendant was in reality attacking his custody under the sentence he was then serving, which was the direct result and the consequence of the earlier conviction.
The federal cases demonstrate that defendants are allowed to attack sentences already served only where they are currently serving a sentence which is directly affected by the previous convictions. On the other hand, where the present confinement is unrelated to the sentence *333 already served, the federal courts hold that the case is either moot or that no jurisdiction is afforded under sec. 2255. U. S. ex rel. Myers v. Smith (2d Cir. 1971), 444 Fed. 2d 75; U. S. ex rel. Collins v. Cady (E. D. Wis. 1971), 322 Fed. Supp. 1168.
While the instant case does not fit precisely under the federal cases which permit an attack upon an earlier conviction, if the defendant is currently serving a sentence related to and affected by the prior conviction, it is difficult to conclude that the question is moot, for, on the face of the record, there is a causal relationship between the defendant's present confinement and the prior conviction which he wishes to attack. In effect, the defendant Theoharopoulos is being held on a detainer and may be subjected to the further penalty of deportation because of the original judgment.
We accordingly conclude that the present case is not moot. See: Fiswick v. United States (1946), 329 U. S. 211, 67 Sup. Ct. 224, 91 L. Ed. 196. The mere fact, however, that the case is not moot for all purposes does not resolve the jurisdictional question.
As stated above, the instant case is distinguishable from second-offender and recidivist cases under the federal law where the defendant was under sentence of a court. Here, no sentence and no process of the state of Wisconsin mandated his custody. The defendant is admittedly in custody pursuant to a federal detainer, and, regardless of the cause-and-effect relationship between the expired sentence and the present custody, it would be unrealistic to conclude that the confinement under the federal detainer is an extension of the state sentence.
The present situation is somewhat analogous to that in Prince v. Bailey (5th Cir. 1972), 464 Fed. 2d 544. In that case, the petitioner sought federal habeas corpus while incarcerated awaiting a state trial. The federal court held that the petitioner was not in custody of state authorities pursuant to a judgment of the state court. *334 The federal court directed that the petition be dismissed for want of jurisdiction.
Similarly, Blair v. United States (10th Cir. 1965), 349 Fed. 2d 405, holds that a sec. 2255 motion does not lie unless the petitioner is in custody under the sentence he desires to attack.
In the instant case, the trial court resolved Theoharopoulos' motion on the merits and denied relief. Were the matter within our jurisdiction, we would affirm the trial court's order. However, because the circuit court acted under circumstances in which jurisdiction was not conferred by the statute, we vacate the circuit court's decision on the merits, and remand with directions to dismiss the petition for lack of jurisdiction.
The result we reach here is admittedly pursuant to a rigid jurisdictional requirement, but it is one imposed upon the courts by the legislature. For jurisdiction, the prisoner must be in custody under the sentence of a state court.
Not all postconviction remedies require custody as a prerequisite to jurisdiction. The American Bar Association Standards Relating to Post-Conviction Remedies, sec. 2.3, advocates that a defendant be able to attack a conviction although he is not in custody and the sentence attacked has been completely served.
While the circumstances here appear to preclude any state remedies, it would appear possible, because the defendant is in federal custody and not the state's, to attack the conviction through federal habeas corpus. It should be noted that state habeas corpus appears inappropriate, because the defendant is in the custody of federal authorities.
The cases of In re United States v. Booth (1856), 59 U. S. (18 How.) 476, 15 L. Ed. 464, and Ableman v. Booth and United States v. Booth (1858), 62 U. S. (21 How.) 506, 16 L. Ed. 169, and related pre-Civil War *335 Wisconsin cases[1] lend ample testimony to the constitutional problems which arise when the state attempts to set aside custody vested in federal authorities. This was one of the issues of the states' rights heresy that was put to rest by force of arms in the Civil War and was given a jurisprudential burial in the case of In re Tarble (1871), 80 U. S. (13 Wall.) 397, 20 L. Ed. 597.
Because the postconviction remedy is jurisdictionally inappropriate to afford relief and state habeas corpus is not constitutionally permissible, it would appear the only possible remedy is that afforded by 28 U. S. Code, sec. 2241, federal habeas corpus.
By the Court.Order vacated, and cause remanded with directions to dismiss the defendant's petition.
NOTES
[1]  In re Booth (1854); 3 Wis. 13 (*1); Ex parte Booth (1854), 3 Wis. 134 (*145); and In re Booth & Rycraft (1854), 3 Wis. 144 (*157).
