
724 P.2d 461 (1986)
James FONDREN, Appellant (Defendant),
v.
The STATE of Wyoming, Appellee (Plaintiff).
No. 86-14.
Supreme Court of Wyoming.
September 2, 1986.
Rehearing Denied September 23, 1986.
Leonard D. Munker, State Public Defender, Julie D. Naylor, Appellate Counsel, Gerald M. Gallivan, Director, and John A. Masterson, Student Intern, Wyoming Defender Aid Program, Laramie, for appellant (defendant).
A.G. McClintock, Atty. Gen., Gerald A. Stack, Deputy Atty. Gen., Criminal Div., John Renneisen, Sr. Asst. Atty. Gen., Gerald P. Luckhaupt, Asst. Atty. Gen., Cheyenne, for appellee (plaintiff).
Before THOMAS, C.J., and BROWN, CARDINE, URBIGKIT and MACY, JJ.
BROWN, Justice.
Appellant James Ray Fondren was convicted of second degree murder in violation of § 6-2-104, W.S. 1977 (June 1983 Replacement), and was sentenced to imprisonment for life.[1] He urges a single issue on appeal:
"Whether appellant's confession in this case came during a period of unlawful detention and thus should have been suppressed as tainted evidence."
We will affirm.
On March 17, 1985, Garland "Slim" Hartwell's body was found in his room at the Berry Hotel in Casper, Wyoming. His throat had been slashed. The coroner's report stated that the cause of Hartwell's death was "exsanguination hemorrhage with blood aspiration." Appellant was questioned about the incident because he had been living with Mr. Hartwell at or about the time of Hartwell's death. Appellant told police, "I did not kill `Slim' Hartwell nor do I know for sure who killed `Slim'."
The following month appellant was arrested on the charge of public intoxication. Public drunkenness is a misdemeanor proscribed by § 3-6, Casper City Code. On April 15, appellant was arraigned on this charge, pled guilty, and fined $55. The next day appellant asked that the fine be converted to a jail sentence. The municipal court converted appellant's fine into a term of seven days in the city jail.[2] While serving the jail sentence appellant was again questioned by police officers about the murder of his occasional roommate. During this interrogation, appellant confessed *462 that he "slashed at `Slim's' neck twice on the left side" and "then slashed the right side of his neck."
Before trial, appellant moved that his confession be suppressed, contending that it was obtained during unlawful detention. The motion was denied. However, the court granted appellant a continuing objection to the admission of his confession. After trial the jury found appellant guilty.
Appellant contends that the trial court erred in not suppressing his confession because the confession was obtained while he was illegally detained on a public intoxication charge. He supports this claim by citing Casper City Code Section 1-7(b), which states in relevant part:
"* * * [A]ny misdemeanor committed in the City of Casper, Wyoming, shall be punishable only by a fine of not more than Seven Hundred Fifty Dollars ($750.00) * * *."
He also contends that a jail sentence is not an authorized punishment under this ordinance, and asserts that his unlawful detention rises to the magnitude of an unconstitutional seizure of his person, a violation of the Fourth Amendment.
For the purposes of this case we will assume that the order of the municipal judge converting the fine into a jail sentence was improper. However, we do not think the case turns on whether the incarceration of appellant was proper or improper.
Appellant cites numerous cases in support of the proposition that under the Fourteenth Amendment to the United States Constitution the "state cannot impose a fine as a sentence and then automatically convert it into a jail term solely because the defendant is indigent." He also cites cases to the effect that a defendant has a Sixth Amendment right to counsel and that under Rule 22, Wyoming Rules of Criminal Procedure for Justices of the Peace and Municipal Courts, an accused has a right to be present at every stage of the proceedings against him.
We do not disagree with these principles argued by appellant, but so far as we can tell they have only minimal application to the circumstances of this case. Despite appellant's suggestion of collateral issues the only issue is, if appellant's detention was illegal, must his subsequent confession to a wholly unrelated crime be suppressed.
In effect, appellant urges that the exclusionary rule be applied to a confession obtained when an accused is illegally incarcerated.[3] Decisions of the United States Supreme Court indicate that the primary purpose of the exclusionary rule is the deterrence of police conduct that violates Fourth Amendment rights. In United States v. Calandra, 414 U.S. 338, 347-348, 94 S.Ct. 613, 619-620, 38 L.Ed.2d 561, 571 (1974), the court said:
"[T]he exclusionary rule was adopted to effectuate the Fourth Amendment right of all citizens `to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures" * *.
"The purpose of the exclusionary rule is not to redress the injury to the privacy of the search victim.
Instead, the rule's prime purpose is to deter future unlawful police conduct * *.
* * * * * *
"* * * [T]he rule is a judicially created remedy designed to safeguard Fourth Amendment rights generally through its deterrent effect rather than a personal constitutional right of the party aggrieved.
* * * * * *
"* * * [T]he application of the rule has been restricted to those areas where its *463 remedial objectives are thought most efficaciously served. * * *"
In Massachusetts v. Sheppard, 468 U.S. 981, ___, 104 S.Ct. 3424, 3429, 82 L.Ed.2d 737, 745 (1984), the appellant was convicted of murder and asserted that evidence against him should be suppressed because it was obtained pursuant to a defective search warrant. The Court stated:
"* * * An error of constitutional dimensions may have been committed with respect to the issuance of the warrant, but it was the judge, not the police officers, who made the critical mistake. `[T]he exclusionary rule was adopted to deter unlawful searches by police, not to punish the errors of magistrates and judges.' Illinois v. Gates, 462 U.S. [213], [263], 76 L.Ed.2d 527, 103 SCt 2317 [2346] (1983) (White, J., concurring in the judgment). Suppressing evidence because the judge failed to make all the necessary clerical corrections despite his assurances that such changes would be made will not serve the deterrent function that the exclusionary rule was designed to achieve. * * *" Massachusetts v. Sheppard, 468 U.S. 981, ___, 104 S.Ct. 3424, 3429, 82 L.Ed.2d 737, 745 (1984).
State v. Osbond, 128 Ariz. 76, 623 P.2d 1232, 1233-1234 (1981), was a case similar to the case before us. In that case the appellant, while serving a sentence in jail for a misdemeanor punishable only by a fine, was questioned by the police and confessed to a murder. The court said:
"* * * [T]he relationship between the detention of appellant on wholly unrelated charges and the subsequent confession to murder is sufficiently attenuated to render the confession admissible. * * * There was no exploitation of any prior illegal police conduct in the attainment of appellant's confession. No deterrent purpose is served by applying the exclusionary rule in these circumstances. [Citation.]"
We agree with the reasoning in Osbond, supra. In the case before us, as in Osbond, appellant was incarcerated on a charge not related to his subsequent charge of murder. As in Osbond there was no "taint" to appellant's confession and we see no reason not to follow Osbond, it being consistent with United States v. Calandra, supra; and Massachusetts v. Sheppard, supra.
Appellant here does not attack the manner in which his confession was obtained except to say that it was taken while he was illegally in custody. The police did not arrest appellant, nor did they detain him. Appellant was in lockup, but his status was not because of anything the police did. If any illegality attached to appellant's incarceration, it was judicial action and not that of the police.
Remembering that the exclusionary rule was adopted to deter unlawful police action and not to punish judges, it would be most inappropriate in this case to exclude appellant's confession, and thus punish the police for something a judicial officer did. Massachusetts v. Sheppard, supra. The purposes of the exclusionary rule would be distorted if applied under the circumstances here. Such application would not serve to deter future illegal police action.
Affirmed.
NOTES
[1]  Section 6-2-104 reads:

"Whoever purposely and maliciously, but without premeditation, kills any human being is guilty of murder in the second degree, and shall be imprisoned in the penitentiary for any term not less than twenty (20) years, or during life."
[2]  Apparently the practice of converting a fine to a jail sentence was only accomplished if a defendant made such a request. The record does not clearly disclose why appellant here requested that his fine be converted into a jail sentence. We do not know that he was financially unable to pay the fine. He might very well have needed a place to stay since a most recent host and roommate had been murdered.
[3]  "This rule commands that where evidence has been obtained in violation of the privileges guaranteed by the U.S. Constitution, the evidence must be excluded at the trial. Evidence which is obtained by an unreasonable search and seizure is excluded from evidence under the Fourth Amendment, U.S. Constitution and this rule is applicable to the States. Mapp v. Ohio, 367 U.S. 643, 81 S.Ct. 1684, 6 L.Ed.2d 1081. * * *" Black's Law Dictionary 506 (5th Ed. 1979).
