*864OPINION OF THE COURT
FELDER, Judge:The appellant stands convicted of a three-month unauthorized absence and three infractions of general regulations in violation of Articles 86 and 92, Uniform Code of Military Justice (UCMJ), 10 U.S.C. §§ 886 and 892. The approved sentence requires our review of the case pursuant to Article 66, UCMJ, 10 U.S.C. § 866.
On 11 March 1974 several American criminal investigators, German policemen and an informant went to the appellant’s civilian apartment located in Hoechst, Germany. The informant and one American investigator went into the apartment and purchased 2 grams of heroin and 196 mandrax tablets from the appellant’s girl friend. The appellant was not present but participating in a field exercise. The drugs were surrendered to the authorities who remained outside the apartment. Immediately thereafter, the American agents and German policemen entered the apartment, searched it, and seized an additional 7 grams of heroin and the money used to make the purchase.
Two days later the appellant was summoned from his unit on maneuvers to the office of the criminal investigators. He was unaware of the incident that occurred on 11 March 1974. He was informed of the controlled purchase of drugs from his girl friend and of the seizure of drugs from his apartment. After waiving his rights to counsel and against self-incrimination, the appellant executed a written statement acknowledging ownership of the substances sold to the informant and the additional quantity of heroin seized by the authorities in the subsequent search.
The appellant was charged with possession of 9 grams of heroin and 196 mandrax tablets. The military judge admitted into evidence the confession made by the appellant and the substances that were purchased, to wit: 2 grams of heroin and 196 mandrax tablets. He ruled that the search of the apartment was unlawful and refused to admit into evidence the 7 grams of heroin that were seized as the result thereof.
The appellant contends on appeal, as he did at trial, that his confession was inadmissible because it is the product of an illegal search. No evidence concerning the voluntariness of the statement was introduced in open court; therefore, the court members did not consider that issue in connection with their deliberation upon the findings.
It is well-settled that a pretrial statement obtained as a result of an illegal search is inadmissible. (United States v. Crow, 19 U.S.C.M.A. 384, 41 C.M.R. 384 (1970)). The mere warning of the rights to counsel and against self-incrimination does not remove the taint so as to make the statement admissible. Brown v. Illinois, 422 U.S. 590, 95 S.Ct. 2254, 45 L.Ed.2d 416 (1975). The exclusionary rule applies to statements derived from an exploitation of the unlawful act but not to statements unaffected by the illegality or obtained from an independent source. United States v. Moore, 19 U.S.C.M.A. 586, 42 C.M.R. 188 (1970); Wong Sun v. United States, 371 U.S. 471, 83 S.Ct. 407, 9 L.Ed.2d 441 (1963); Costello v. United States, 365 U.S. 265, 81 S.Ct. 534, 5 L.Ed.2d 551 (1961). Whether a confession is an exploitation of an unlawful act must be answered on the facts of each case. In addition to the warning, such factors as the temporal proximity of the illegal search and confession, the presence of intervening circumstances and, particularly, the purpose and flagrancy of official misconduct are relevant. The burden of showing admissibility rests, of course, on the prosecution. See Brown v. Illinois, supra 422 U.S. at 603-04, 95 S.Ct. 2254.
Despite the illegal search of the appellant's dwelling, the planned purchase of prohibited substances from his girl friend was an independent transaction which provided a lawful basis for interrogating him. Both the search and purchase were utilized in good faith by the officials in their interrogation of the appellant and the statement is a derivative of both factors. We hold that since the search was not exploited to any greater degree than the purchase and the purchase alone would have produced the *865statement,* the statement was voluntary and admissible.
The findings of guilty and the sentence are affirmed.
Senior Judge JONES concurs.The appellant testified that he would not have admitted ownership of the drugs had he been advised by the investigator only of the controlled purchase and that he confessed only because he was informed that drugs were discovered in his apartment. We, and apparently the trial judge also, do not attach much credence to that portion of his testimony.