
270 S.C. 577 (1978)
243 S.E.2d 455
The STATE, Respondent,
v.
James Donald SHELTON, Appellant.
20668
Supreme Court of South Carolina.
April 19, 1978.
*578 Douglas F. Patrick, Greenville, for appellant.
Atty. Gen. Daniel R. McLeod, Asst. Attys. Gen. Brian P. Gibbes and Edward B. Latimer, Columbia, and Sol. William W. Wilkins, Jr., Greenville, for respondent.
April 19, 1978.
LEWIS, Chief Justice:
Appellant was convicted of carrying and having in his possession a pistol in the hall and courtroom of the Greenville County Courthouse in violation of Section 16-23-420 of the 1976 Code of Laws. This section makes it unlawful *579 for any person to carry into any publicly owned building, or to have in his possession in the area immediately adjacent to such building, a firearm of any kind, without express permission of the authorities in charge of the buildings. The statute further provides that:
The provisions of this section shall not apply to any guard, law enforcement officer or member of the armed forces, or to any student of military science, or to any married student residing in apartments provided by such private or public school whose presence with a weapon in or around a particular building is authorized by persons legally responsible for the security of such buildings.
The material facts are not in dispute. Appellant and his wife had been involved in an action for the foreclosure of a mortgage in which a decree had been issued for the sale of their home. When it came to the attention of the trial judge that appellant's wife had not been notified of the sale, an order was issued restraining the sale and a rule issue directed to appellant and his wife to show cause why the property should not be sold at a later date. Several days prior to the return date set on the rule to show cause, the trial judge received reliable information that appellant carried a gun, had threatened one of the local attorneys, and had threatened to kill a neighbor if he came upon his property.
On the date set, appellant appeared for the hearing on the rule to show cause. Upon his appearance in the hall adjacent to the courtroom, the trial judge, as a security precaution, instructed the officers to bring the appellant into the courtroom and search him. Appellant was accordingly brought into the courtroom, searched without a search warrant in the presence of the court, and a loaded pistol removed from appellant's person. The pistol was delivered to the trial judge and retained in his possession until the present trial, at which time it was introduced into evidence over appellant's objection.
*580 Appellant contends that the warrantless courtroom search violated his constitutionally protected right against unreasonable searches and seizures and, therefore, the pistol removed from his person during such illegal search was inadmissible in evidence. Appellant argues that, under the present facts, a search warrant was required in order to legally effectuate the search of his person.
The record shows that the search of appellant was reasonable and violated none of his constitutional rights. The search was conducted in the courtroom, at the direction of the trial judge and in his presence, just prior to a civil hearing in which the appellant was a litigant. The search was made in order to preserve the safety of those participating in the court proceedings and pursuant to reliable information that appellant carried a weapon and had previously made threats against an attorney and a neighbor. The search was made for the limited purpose of obtaining appellant's weapon, if he carried one, and was confined to that purpose.
A trial judge has the inherent power to preserve order in his court and to see that justice is not obstructed by any person or persons. He has the authority to take such measures as appear reasonably necessary to secure orderly proceedings and to preserve the security of those participating in the trial or lawfully attending the proceedings. The exercise of this authority by the trial judge is not inhibited by the guarantees of the Fourth Amendment. Therefore, the Fourth Amendment protection against unreasonable searches and seizures is inapplicable to a courtroom in the exercise of the trial judge's authority and duty to preserve security and order.
The fact that the trial judge learned several days before the hearing of appellant's dangerous propensities did not, as argued by appellant, require the trial judge to secure a search warrant in order to lawfully seize the pistol carried by appellant into the courtroom. This right to search for security purposes did not arise until the security of the courtroom was threatened, and was not lost *581 because the trial judge failed to act sooner by securing a search warrant.
What security measures are warranted to preserve the security of the trial must be determined by the judge under the facts and circumstances in each case, and the exercise of this power is subject to review only to determine the reasonable necessity for the security taken. State v. Gore, 257 S.C. 330, 185 S.E. (2d) 826; State v. Smith, 259 S.C. 309, 191 S.E. (2d) 638.
The record sustains the conclusion that the precautions taken by the trial judge were reasonably necessary and did not violate appellant's Fourth Amendment rights.
Appellant also argues that he was entitled to a directed verdict of acquittal because the State failed to offer evidence to show that his conduct did not fall within one of the exceptions of Section 16-23-420, quoted hereinabove. These exceptions state that the prohibition of the section shall not apply to one armed on the premises as a guard, law enforcement officer, member of the military, a student of military science, or a resident married student authorized to carry a weapon thereon.
We need not pursue the argument of appellant that the burden of proof is on the State to prove that a defendant, charged under this section, did not fall within one of the exceptions, since the record shows that appellant was not authorized to carry the weapon into the Greenville County Courthouse. Appellant was in the courthouse to respond to a civil process which, as a matter of law, did not authorize him to bring his pistol with him. He conceded that he was not a law enforcement officer, a guard at the courthouse, nor a member of the armed forces. There is no contention that he was given express permission to carry the weapon. Certainly, he was not a student about a school building.
All exceptions are overruled and the judgment is affirmed.
LITTLEJOHN, NESS and RHODES, JJ., and JOSEPH R. MOSS, Acting Associate Justice, concur.
