Opinion of the Court
FLETCHER, Chief Judge:The appellant’s court-martial resulted in his conviction of two specifications of failing to report contact with persons believed by him to be agents of governments hostile to the United States and one specification of attempted espionage, in violation of Articles 92 and 134, respectively, Uniform Code of Military Justice, 10 U.S.C. §§ 892 and 934. The appellant challenges the validity of his conviction on several grounds. We find it necessary for the resolution of this case to address only two: first, the failure of the military judge to sua sponte instruct the court members on evidence of uncharged misconduct; and, second, the denial of his right to a public trial. We find on both counts the judge erred.
The facts are not in dispute. The appellant, after a series of discussions with three individuals, each of whom worked covertly for the government, failed to report these conversations and ultimately attempted to communicate information relating to national defense, contrary to Air Force Regulation 205-37 and 18 U.S.C. § 793(d).
Throughout the proceedings the prosecution adduced numerous acts of misconduct, over defense objection, including possible earlier acts of espionage. The military judge, in an Article 39(a), 10 U.S.C. § 839(a), session, subsequent to the presentment of evidence on the merits, accurately noted each act of uncharged misconduct. He correctly stated that he was required to instruct the court members as to the limited purpose of this evidence. Appellant’s counsel requested that an uncharged misconduct instruction not be given. The judge considered the request and did not so instruct.
No evidence can so fester in the minds of court members as to the guilt or innocence of the accused as to the crime charged as evidence of uncharged misconduct. Its use must be given the weight of judicial comment, i. e., an instruction as to its limited use.1 United States v. Gaiter, 23 U.S.C.M.A. 438, 50 C.M.R. 397, 1 M.J. 54 (1975).
This Court’s statement in United States v. Graves, 23 U.S.C.M.A. 434, 437, 50 C.M.R. 393, 396, 1 M.J. 50, 53 (1975):
Irrespective of the desires of counsel, the military judge must bear the primary responsibility for assuring that the jury properly is instructed on the elements of the offenses raised by the evidence as well as potential defenses and other questions of law. Simply stated, counsel do not frame issues for the jury; that is the duty of the military judge based upon his evaluation of the testimony related by the witnesses during the trial,
encases the judge’s obligation to instruct. When evidence of uncharged misconduct is permitted, nothing short of an instruction will suffice.
*120As to the second error, the military judge during the preliminary Article 39(a) session, stated that because the trial on the espionage charges could delve into classified matters, certain procedures would be instituted. These included ascertaining that all court members and personnel would have the appropriate security clearances, and that the public would be excluded from portions of the trial. Thus, despite the objection of the defense counsel, and the trial judge’s own assurances that he would “bend over backwards” to protect the appellant’s rights, the public was excluded from virtually the entire trial as to the espionage charges.2 During this portion of the trial, nine witnesses testified, only one of whom discussed classified matters at any length. Of the remaining eight witnesses one made less than 10 references to classified matters, three made only one reference, and the remaining four made no references. In excising the public from the trial, the trial judge employed an ax in place of the constitutionally required scalpel.
The right of an accused to a public trial is a substantial right secured by the Sixth Amendment to the Constitution of the United States. In re Oliver, 333 U.S. 257, 68 S.Ct. 499, 92 L.Ed. 682 (1948). Indeed, this Court has long held that an accused is, at the very least, entitled to have his friends, relatives, and counsel present regardless of the offense charged. United States v. Brown, 7 U.S.C.M.A. 251, 22 C.M.R. 41 (1956).3 The improper exclusion of the public has been treated as error per se in recognition that to do otherwise is to place the defendant in the ironic position of having “to prove what the disregard of his constitutional right has made it impossible for him to learn.” United States ex rel. Bennett v. Rundle, 419 F.2d 599, 608 (3d Cir. 1969).4
As recognized in United States v. Brown, supra, the right to a public trial is not absolute, and under exceptional circumstances, limited portions of a criminal trial may be partially closed over defense objection.5 In each instance the exclusion must be used sparingly with the emphasis always toward a public trial. Historical exceptions have evolved and expanded6 which need *121not be discussed, for the stated basis for the exclusion of the public in this case was the fact that classified or security matters might be presented. Exclusion of the public on such a basis is provided for in paragraph 53e, Manual for Courts-Martial, United States, 1969 (Rev.) which provides in pertinent part that:
As a general rule, the public shall be permitted to attend open sessions of courts-martial. Unless otherwise limited by directives of the Secretary of a Department, the convening authority, the military judge, or the president of a special court-martial without a military judge may, for security or other good reasons, direct that the public or certain portions thereof be excluded from a trial. However, all spectators may be excluded from an entire trial, over the accused’s objection, only to prevent the disclosure of classified information. The authority to exclude should be cautiously exercised, and the right of the accused to a trial completely open to the public must be weighed against the public policy considerations justifying exclusion.
Although the presentation of classified or security matters did not develop as an historical exception to the requirement of a public trial, this Court recognizes that, within carefully limited guidelines, partial exclusion of the public on such a basis can be justified. Military appellate courts have noted the necessity to require that court personnel and members have designated security clearances, and that questions of classified materials could properly be disposed of in closed sessions. United States v. Kauffman, 33 C.M.R. 748, 795 (A.B.R.), reversed on other grounds, 14 U.S.C.M.A. 283, 34 C.M.R. 63 (1963);7 United States v. Northrup, 31 C.M.R. 599 (A.F.B.R.1961); United States v. Dobr, 21 C.M.R. 451 (A.B.R.1956). Yet, in each instance the exclusion of the public was narrowly and carefully drawn. The blanket exclusion of the spectators from all or most of a trial, such as in the present case, has not been approved by this Court, nor could it be absent a compelling showing that such was necessary to prevent the disclosure of classified information.8 The simple utilization of the terms “security” or “military necessity” cannot be the talisman in whose presence the protections of the Sixth Amendment and its guarantee to a public trial must vanish.9 Unless an appropriate balancing test is employed with examination and analysis of the need for, and the scope of any suggested exclusion, the result is, as here, unsupportable.
It is our decision that the balancing test employed by a trial judge in instances *122involving the possible divulgence of classified material should be as follows. His initial task is to determine whether the perceived need urged as grounds for the exclusion of the public10 is of sufficient magnitude so as to outweigh “the danger of a miscarriage of justice which may attend judicial proceedings carried out in even partial secrecy.” Stamicarbon, N.V. v. American Cyanamid. Co., 506 F.2d 532, 539 (2d Cir. 1974). This may be best achieved by conducting a preliminary hearing which is closed to the public at which time the government must demonstrate that it has met the heavy burden of justifying the imposition of restraints on this constitutional right.11 The prosecution to meet this heavy burden must demonstrate the classified nature, if any, of the materials in question. It must then delineate those portions of its case which will involve these materials.
It is acknowledged that special deference should be accorded matters of national security. Ethyl Corporation v. Environmental Protection Agency, 478 F.2d 47 (4th Cir. 1973); Epstein v. Resor, 421 F.2d 930 (9th Cir. 1970). Although the actual classification of materials and the policy determinations involved therein are not normal judicial functions, immunization from judicial review cannot be countenanced in situations where strong countervailing constitutional interests exist which merit judicial protection. United States v. United States District Court, 407 U.S. 297, 92 S.Ct. 2125, 32 L.Ed.2d 752 (1972).12 Before a trial judge can order the exclusion of the public on this basis, he must be satisfied from all the evidence and circumstances that there is a reasonable danger that presentation of these materials before the public will expose military matters which in the interest of national security should not be divulged. United States v. Reynolds, 345 U.S. 1, 73 S.Ct. 528, 97 L.Ed. 727 (1953). The method used by the prosecution to satisfy this burden, as recognized in United States v. Reynolds, supra, will vary depending upon the nature of the materials in question and the information offered. It is important to realize that this initial review by the trial judge is not for the purpose of conducting a de novo review of the propriety of a given classification decision.13 All *123that must be determined is that the material in question has been classified by the proper authorities in accordance with the appropriate regulations. Brockway v. Department of the Air force, 518 F.2d 1184 (8th Cir. 1975).14 The ultimate questions of whether these materials “relat[ed] to the national defense”15 and could be used to the injury of the United States or the advantage of a foreign country must remain for resolution by the jury. 18 U.S.C. § 793(d). The sole purpose of this review is to protect an accused’s right to a public trial by preventing circumvention of that right by the mere utterance of a conclusion or blanket acceptance of the government’s position without a demonstration of a compelling need. United States v. Nixon, 418 U.S. 683, 94 S.Ct. 3090, 41 L.Ed.2d 1039 (1974).16
This Court appreciates full well that such a hearing may involve complex and delicate matters for resolution by the trial judge, yet, as recognized by the Supreme Court, these are matters that judicial officers must and should be equipped to properly determine. United States v. United States District Court, supra. Similarly, we feel that objections to this procedure because of the possibility of “leaks” are insufficient to prohibit its use; adequate measures exist to insure the necessary confidentiality required when matters of national security are concerned.17
The trial judge’s determination that the prosecution has met its burden as to the nature of the materials18 does not complete his review in this preliminary hearing. He must further decide the scope of the exclusion of the public. The prosecution must delineate which witnesses will testify on classified matters, and what portion of each witness’ testimony will actually be devoted to this area. Clearly, unlike the instant case, any witness whose testimony does not contain references to classified material will testify in open court. The witness whose testimony is only partially concerned with this area should testify in open court on all other matters. For even assuming a valid underlying basis for the exclusion of the public, it is error of “constitutional magnitude”19 to exclude the public from all of a given witness’ testimony when only a portion is devoted to classified material. The remaining portion of his testimony will be presented to the court members in closed session. This bifurcated presentation of a given witness’ testimony is the most satisfactory resolution of the competing needs for secrecy by the government, and for a public trial by the accused.20 It *124will be incumbent upon the trial judge to sua sponte instruct the court members both as an introductory matter and in greater detail during his final instructions as to the underlying basis for the use of this bifurcated process. It is imperative that the court members determine whether the documents or information in question are violative of the espionage statute based solely upon the evidence presented. Neither the utilization of a particular document marking, nor the presentation of certain testimony in closed sessions can be, in and of itself, sufficient to sustain a conviction. Dubin v. United States, 363 F.2d 938, 176 Ct.Cl. 702 (1966); United States v. Drummond, 354 F.2d 132 (2d Cir. 1965).21
Applying the above criteria and procedures to the facts of the instant case it is abundantly clear that the military judge committed error of constitutional magnitude. His blanket exclusion of the public failed to satisfactorily balance the competing interests, and improperly denied the appellant his right to a public trial.22
Reversal is required. The findings and sentence as approved by the United States Air Force Court of Military Review are set aside. The record of trial is returned to the Judge Advocate General of the Air Force. A rehearing may be ordered.
Judge PERRY concurs.. The basic legal tenet and the seven exceptions to that rule which permit the introduction of uncharged misconduct are set forth in paragraph 138g of the Manual for Courts-Martial, United States, 1969 (Rev.), as reiterated by this Court in United States v. Janis, 1 M.J. 395 (1976). The fact that this evidence was admissible under that test gives rise to the question of the need for an instruction.
. The propriety or impropriety of the exclusion of the public from all or part of a trial cannot, as attempted by the government in this case, be reduced to solution by mathematical formulas. The logic and rationale governing the exclusion, not mere percentages of the total pages of the record, must be dispositive.
The dissenting judge has apparently adopted the government position that as over 60 percent of the total record was conducted in open session, there can be little or no question but that the trial judge exercised discretion in his exclusion of the public. Unfortunately what both the dissenting judge and the government have failed to do is to analyze what portions of the record are involved in this question. The “over 60 percent” figure which has been bandied about entails the preliminary procedural matters the entire trial on the merits as to the charge of which the appellant was acquitted, final instructions, and the sentencing phase of the trial. The fact that these portions of the trial were open to the public can have no bearing on the resolution of the propriety of the judge’s exclusion of the public from virtually the entire trial as to the espionage matters. Further, simple examination of the record reveals that the “bulk of the closed session” did not contain numerous and repeated references to classified matters; in fact, as noted by the government in its pleadings, only two witnesses of the total of nine would fit into this category.
. This Court is in full agreement with the concurrence of then Chief Judge Quinn that the right to a public trial is indeed required in a court-martial. To the extent that United States v. Brown, 7 U.S.C.M.A. 251, 22 C.M.R. 41 (1956), implies a “military exception” to the right to a public trial for service personnel in reliance upon Ex parte Quirin, 317 U.S. 1, 63 S.Ct. 1, 87 L.Ed. 3 (1942), it is overruled.
. See United States v. Zimmerman, 19 C.M.R. 806 (A.F.B.R.1955); United States v. Kobli, 172 F.2d 919 (3d Cir. 1949); Tanksley v. United States, 145 F.2d 58, 10 Alaska 443 (9th Cir. 1944).
. See United States ex rel. Lloyd v. Vincent, 520 F.2d 1272 (2d Cir. 1975); Stamicarbon, N.V. v. American Cyanamid Co., 506 F.2d 532 (2d Cir. 974).
. See e. g. Note, The Accused’s Right to a Public Trial, 42 Notre Dame Law 499 (1967); Note, The Right to a Public Trial in Criminal Cases, 41 N.Y.U.L.Rev. 1138 (1966); Radin, The Right to a Public Trial, 6 Temp.L.Q. 381 *121(1932). These traditional exceptions have been broadened to include limited exclusions to protect undercover policemen or agents, to insure full and honest testimony by government witnesses, to protect airline hijacking profiles, and to preserve order. United States v. Ruiz-Estrella, 481 F.2d 723 (2d Cir. 1973); United States ex rel. Bruno v. Herold, 408 F.2d 125 (2d Cir. 1969); United States ex rel. Orlando v. Fay, 350 F.2d 967 (2d Cir. 1965). See Illinois v. Allen, 397 U.S. 337, 90 S.Ct. 1057, 25 L.Ed.2d 353 (1970); Bloom v. Illinois, 391 U.S. 194, 88 S.Ct. 1477, 20 L.Ed.2d 522 (1968).
. In United States v. Kauffman, 33 C.M.R. 748, 795 (A.B.R.1963), the limited exclusion of the public during the portion of one witness’ testimony on espionage matters was sustained. It should be noted, however, that the exclusion was so limited that no evidence was offered, and instead only procedural matters were discussed which did not relate to the question of guilt or innocence. See United States v. Henderson, 11 U.S.C.M.A. 556, 564, 29 C.M.R. 372, 380 (1960).
. See United States v. Michaud, 48 C.M.R. 379 (N.C.M.R.1973).
. This Court recognizes that the Supreme Court in Parker v. Levy, 417 U.S. 733, 743, 94 S.Ct. 2547, 41 L.Ed.2d 439 (1974), acknowledged the uniqueness of the military society, and that it has reaffirmed that belief in recent decisions. See Middendorf v. Henry, 425 U.S. 25, 96 S.Ct. 1281, 47 L.Ed.2d 556 (1976); Greer v. Spock, 424 U.S. 828, 96 S.Ct. 1211, 47 L.Ed.2d 505 (1976); Schlesinger v. Councilman, 420 U.S. 738, 95 S.Ct. 1300, 43 L.Ed.2d 591 (1975). Yet, this Court once again must state that analysis and rationale will be determinative of the propriety of given situations, and that the mere uniqueness of the military society or military necessity cannot be urged as the basis for sustaining that which reason and analysis indicate is untenable See United States v. Robel, 389 U.S. 258, 88 S.Ct. 419, 19 L.Ed.2d 508 (1967).
. Our inquiry deals solely with requests for exclusion by the government and differs from the considerations employed when the defendant requests exclusion of the public in order to insure a fair trial. See Sheppard v. Maxwell, 384 U.S. 333, 86 S.Ct. 1507, 16 L.Ed.2d 600 (1966); Estes v. Texas, 381 U.S. 532, 85 S.Ct. 1628, 14 L.Ed.2d 543 (1965).
. See New York Times Co. v. United States, 403 U.S. 713, 91 S.Ct. 2140, 29 L.Ed.2d 822 (1971). It is recognized that in this case the Supreme Court was concerned with First Amendment questions; however, the principles enunciated in regard to government’s attempts to prevent the disclosure of matters in the name of “security” are applicable to the “public trial” aspects of the Sixth Amendment present in this case.
. The Supreme Court upheld the requirement of judicial scrutiny in the form of prior warrant procedures before the utilization of wiretaps under the Omnibus Crime Control and Safe Streets Act, 18 U.S.C. §§ 2510-2520. Government contentions that “domestic security” concerns must prevail over the protections of the Fourth Amendment were rejected. The Court did not address the question of “foreign” security matters, but instead carefully limited its holding in this and subsequent cases to “domestic” security questions. See Russo v. Byrne, 409 U.S. 1219, 93 S.Ct. 21, 34 L.Ed.2d 30 (1972) . However, the overriding concerns expressed by the Supreme Court in that case have been recently applied to matters concerning foreign security surveillance as well. Zweibon v. Mitcheli, 170 U.S.App.D.C. 1, 516 F.2d 594 (1975). We feel that this rationale is sound at least as it relates to the propriety of judicial scrutiny, and the ability of the trial judge to properly exercise this scrutiny.
. Environmental Protection Agency v. Mink, 410 U.S. 73, 93 S.Ct. 827, 35 L.Ed.2d 119 (1973) . This case involves analysis of the Freedom of Information Act as originally enacted. Both subsequent congressional modification of that act, and the presence of additional constitutional concerns found in criminal prosecutions lead us to conclude that the trial judge may utilize in camera inspection of the material to determine whether the prosecution has met its burden should he deem it necessary. United States v. Nixon, 418 U.S. 683, 94 S.Ct. 3090, 41 L.Ed.2d 1039 (1974); Schaffer v. Kissinger, 164 U.S.App.D.C. 282, 505 F.2d 389 (1974). See Zweibon v. Mitchell, supra.
. The potential for abuses may exist, and upon proper motion it is incumbent upon the trial judge to determine whether a particular classification was done in an arbitrary and capricious manner, thereby compelling its disclosure. Wolfe v. Froehlke, 166 U.S.App.D.C. 274, 510 F.2d 654 (1974); Schaffer v. Kissinger, supra; Epstein v. Resor, 421 F.2d 930 (9th Cir. 1970).
. See United States v. Drummond, 354 F.2d 132 (2d Cir. 1965).
. See also Rowley v. McMillan, 502 F.2d 1326 (4th Cir. 1974).
. See Alderman v. United States, 394 U.S. 165, 89 S.Ct. 961, 22 L.Ed.2d 176 (1969).
. This determination does not preclude the defense from going forward and demonstrating the “public” nature of the material which would thus establish a separate ground prohibiting exclusion of the public. See 18 U.S.C. § 793.
. United States v. Clark, 475 F.2d 240, 246 (2d Cir. 1973). The Second Circuit sustained the underlying basis for the exclusion in reliance upon its prior decision of United States v. Bell, 464 F.2d 667 (2d Cir. 1972) —prevention of the disclosure of airline skyjacking profiles because of a compelling need to protect the air traveling public. However, the court would not permit the total exclusion of the public in a hearing where only a portion of the testimony presented related to this profile, and the remainder, as here, was devoted to a wide range of matters bearing on the defendant’s innocence or guilt.
. This was the procedure employed by the trial court and sustained by this Court in United States v. Kauffman, supra. We share the conclusion expressed in United States v. Clark, supra, that:
Nor does the remote possibility of an unsolicited, spontaneous disclosure of the elements of the profile justify such a broad policy of exclusion. Since the witnesses were aware of the government’s desire to maintain the *124secrecy of the profile, the risk of inadvertent disclosure was negligible.
475 F.2d at 246. A cautionary instruction to the witness should more than adequately protect the government’s interests in a given case.
The Court recognizes that not every situation is easily “pigeon-holed” into testimony which is devoted to classified material and that which is not; as noted earlier in this opinion, we feel that trial judges should and must be capable of exercising sound discretion in their rulings. Clearly, therefore, the trial judge need not participate in so rigid a procedure as to turn his courtroom into a parade; continuity of testimony and the fact that a given witness’ testimony deals virtually exclusively with classified material are certainly factors which could lead to the exclusion of the public from all of a given witness’ testimony regardless of the fact that a portion was not concerned with such matters. The procedure we set forth is to protect an individual’s rights under the Sixth Amendment and to prevent those rights from being ignored on the basis of unthinking acceptance of government claims of need without the appropriate demonstration of that need.
. It must be apparent that exclusion of the public during a trial may cause some court members to erroneously conclude that as the witness or document needs protection, the testimony must be true, and therefore, the defendant’s innocence is to be doubted. Note, Exclusion of the General Public From A Criminal Trial — Some Problem Areas, 1966 Wash.U.L.Q. 458. See Quick, A Public Criminal Trial, 60 Dick.L.Rev. 21, 28 (1955). The fears expressed by the Supreme Court in Jackson v. Denno, 378 U.S. 368, 84 S.Ct. 1774, 12 L.Ed.2d 908 (1964), that jurors cannot understand the policy consideration calling for the given exclusion are applicable to this situation. Hence, cautionary instructions tailored to the facts of the particular case are mandated lest the very purpose behind the procedures discussed be thwarted.
. The dissenting judge complains that the procedure which we adopt is defective because it unfairly compromises the governmental interests involved, and because the government is not protected from an arbitrary, or presumably a good faith but incorrect, ruling compelling disclosure of certain materials. We can share his concern that Congress has failed to provide our system with statutory authorization for Government appeals in criminal cases. See United States v. Rowel, 1 M.J. 289 (1976) (Fletcher, C. J. concurring). However, congressional inaction cannot abrogate our obligation to insure that each accused in the military justice system is afforded his rights under the Sixth Amendment.