
895 P.2d 545 (1995)
The BOARD OF COUNTY COMMISSIONERS OF WELD COUNTY, Ed Jordan, Sheriff of Weld County, Petitioners,
v.
In re Matter of NINETEENTH JUDICIAL DISTRICT, Respondent.
No. 94SC655.
Supreme Court of Colorado, En Banc.
May 22, 1995.
*546 Bruce T. Barker, Weld County Atty., Cyndy Giauque, Asst. County Atty., Greeley, for petitioners.
Gale A. Norton, Atty. Gen., Stephen K. ErkenBrack, Chief Deputy Atty. Gen., Timothy M. Tymkovich, Sol. Gen., Maurice G. Knaizer, Deputy Atty. Gen., General Legal Services Div., Denver, for respondent.
Justice ERICKSON delivered the Opinion of the Court.
We granted certiorari before judgment to review In re Matter of Nineteenth Judicial District, No. 94CV1653 (Weld County Dist. Ct. Aug. 17, 1994),[1] pursuant to C.A.R. 50.[2] Respondent Nineteenth Judicial District (Chief Judge) entered an order requiring that petitioner Weld County Sheriff (Sheriff) provide security for the Weld County Courthouse (Courthouse) and specifying that petitioner Board of County Commissioners of Weld County (Board) pay for security equipment and for the personnel to operate the equipment. Petitioners' motion for reconsideration was denied, and this appeal followed. We affirm the district court's order in part and reverse in part. We affirm that part of the order that requires the Sheriff to provide *547 security for the Courthouse. We reverse, on the record before us, the part of the district court's order requiring the Board to pay for security equipment and the personnel to operate the equipment.

I
During the past several years, judges, court personnel, and parties have been the subject of numerous threats of bodily injury or death. The Courthouse has received bomb threats, and gang confrontations have occurred in its halls. Weld County's experiences are consistent with events in other counties. For example, since 1986 the Arapahoe County courthouse has endured two shooting incidents resulting in death or serious bodily injury. In 1988, a kidnapping took place in Mesa County's courthouse.
In response to the threats of violence, the Chief Judge of the Nineteenth Judicial District met with the Board and the Sheriff to discuss methods for providing a safe and secure Courthouse environment. After several discussions, the Sheriff presented his views in a memorandum to the Board dated December 30, 1993. The Sheriff recommended that: (1) a metal detector be used to exclude firearms and edged weapons from the Courthouse; (2) security checkpoints be placed at the south and east doors of the Courthouse; (3) each checkpoint be staffed by a guard and equipped with ropes and station posts; (4) a workstation be installed, including a desk, a telephone extension, a computer terminal, and a printer; and (5) the workstation be staffed by a uniformed deputy sheriff approximately sixty percent to seventy percent of the time that the building was open to the public.
The Chief Judge and the Board were unable to agree on the method of financing the recommended changes. The Chief Judge concluded that the Board was responsible for providing security for the Courthouse in accordance with the Sheriff's recommendations. On August 17, 1994, the Chief Judge entered an order requiring that the Sheriff provide security for the Courthouse "substantially in accord with [the] Sheriff['s] ... memo ... dated December 30, 1993." The order also specified that the Board pay the costs of the security equipment and personnel. The Chief Judge based his conclusions on section 13-1-114(2), 6A C.R.S. (1987),[3] section 30-10-515, 12A C.R.S. (1987), and case law supporting the inherent powers of the court. The Board and the Sheriff filed a joint motion for reconsideration. The motion was denied, and they appealed.

II

Inherent Powers Doctrine

A
In Pena v. District Court, 681 P.2d 953 (Colo.1984), we affirmed the basic principles underlying the inherent powers doctrine.
The inherent powers which courts possess consist of: "[A]ll powers reasonably required to enable a court to perform efficiently its judicial functions, to protect its *548 dignity, independence, and integrity, and to make its lawful actions effective. These powers are inherent in the sense that they exist because the court exists; the court is, therefore it has the powers reasonably required to act as an efficient court."
Id. at 956 (quoting Jim R. Carrigan, Inherent Powers and Finance, Trial, Nov.-Dec. 1971, at 22, 22). The separation of powers doctrine provides the basis for the inherent powers of the courts.[4] Previously, we stated:
In their responsibilities and duties, the courts must have complete independence. It is not only axiomatic, it is the genius of our government that the courts must be independent, unfettered, and free from directives, influence, or interference from any extraneous source. It is abhorrent to the principles of our legal system and to our form of government that courts, being a coordinate department of government, should be compelled to depend upon the vagaries of an extrinsic will. Such would interfere with the operation of the courts, impinge upon their power and thwart the effective administration of justice. These principles, concepts, and doctrines are so thoroughly embedded in our legal system that they have become bone and sinew of our state and national polity.
Smith v. Miller, 153 Colo. 35, 40-41, 384 P.2d 738, 741 (1963); see also Chiles v. Children A, B, C, D, E, and F, 589 So.2d 260, 264 (Fla.1991) ("[N]o branch [of government] may encroach upon the powers of another."); In re Alamance County Court Facilities, 329 N.C. 84, 405 S.E.2d 125, 129 (1991) ("A court's inherent power is that belonging to it by virtue of its being one of three separate, coordinate branches of the government."); In re Salary of Juvenile Director, 87 Wash.2d 232, 552 P.2d 163, 171 (1976) ("[C]ourts possess inherent power, that is, authority not expressly provided for in the constitution but which is derived from the creation of a separate branch of government and which may be exercised by the branch to protect itself in the performance of its constitutional duties."). However, a court's inherent power is not unlimited and may be exercised only in certain situations.
A court's inherent authority is generally limited to matters that are reasonably necessary for the proper functioning of the judiciary. See In re Alamance County Court Facilities, 405 S.E.2d at 129; In re Salary of Juvenile Director, 552 P.2d at 173; see also Smith, 153 Colo. at 41, 384 P.2d at 741 (stating that "those who control the purse" should not pay expenses "only where the amounts are so unreasonable as to affirmatively indicate arbitrary and capricious acts"). While the separation of powers doctrine prevents another branch of government from encroaching upon the judiciary, the same principle bars a court from intruding into the affairs of the legislative or executive branches. See Kort v. Hufnagel, 729 P.2d 370, 373 (Colo.1986) ("The doctrine of separation of powers imposes upon the judiciary a proscription against interfering with the executive or legislative branches and operates to prohibit the judiciary from preempting an executive agency from exercising powers properly within its own sphere."); In re Alamance County Court Facilities, 405 S.E.2d at 133 ("The inherent power of the court must be exercised with as much concern for its potential to usurp the powers of another branch as for the usurpation it is intended to correct."). An appropriate use of the inherent powers doctrine recognizes the subtle balancing of the three branches of government, which is necessary to further the public interest of a cooperative and harmonious governmental structure. See Kort, 729 P.2d at 373.
Applying these principles to the present case, the Chief Judge properly ordered security to ensure the continuing viability of the courts. Without security the public's confidence in the integrity of the judicial system is threatened. The proper administration of justice requires that courts operate *549 in a safe and secure environment. When society views the security of the court system with skepticism, the authority of the judicial branch is diminished. A weak judicial branch prevents a proper functioning of the tripartite scheme of government. The Chief Judge properly ordered security so the courts may continue to fulfill their constitutional mandate and administer justice in an orderly and dignified atmosphere.
A court's inherent authority terminates when its ability to carry out its constitutional duty to administer justice is no longer threatened. The Chief Judge's order that the Sheriff's recommendation for security in the Courthouse be complied with was proper. However, the order directing the Board to pay for the security measures is not supported by the record.
We recognize that when the action of another branch of government "threatens fiscally to undermine the integrity of the judiciary, a court may invoke its inherent power to do what is reasonably necessary for `the orderly and efficient exercise of the administration of justice.'" In re Alamance County Court Facilities, 405 S.E.2d at 132 (quoting Beard v. North Carolina State Bar, 320 N.C. 126, 357 S.E.2d 694, 696 (1987)); see also Ridenour v. Schwartz, 179 Ariz. 1, 4, 875 P.2d 1306, 1309 (1994) ("[T]he legislative or executive branches cannot, through lack of proper planning, budgeting or funding, require the judicial branch to take cost-cutting measures so severe that the operation of the judicial system cannot be carried out in a constitutional manner."). By ordering security for the proper administration of justice, the Chief Judge legitimately used his inherent authority. If the Board fails to provide financial support to the Sheriff's implementation of the Chief Judge's order, the Chief Judge may determine that further orders are required to provide security for the Courthouse.

B
Although ordering specific fiscal action by another branch of government is outside the judiciary's inherent authority, the use of a court's contempt power is not. The United States Supreme Court stated:
The power to punish for contempt is inherent in all courts; its existence is essential to the preservation of order in judicial proceedings, and to the enforcement of the judgments, orders, and writs of the courts, and consequently to the due administration of justice. The moment the courts of the United States were called into existence and invested with jurisdiction over any subject, they became possessed of this power.
Ex Parte Robinson, 86 U.S. (19 Wall.) 505, 510, 22 L.Ed. 205 (1873); see also In the Interest of J.E.S., 817 P.2d 508, 511 (Colo. 1991) ("The judiciary's authority to punish for contempt of court has long been recognized as an inherent power essential to the effective administration of justice."); I ABA Standards for Criminal Justice, Special Functions of the Trial Judge, Standard 6-4.1 (2d ed. 1980 & 1986 Supp.) (discussing the inherent power of the court to punish for contempt). To shield "judicial power from legislative control under the separation of powers doctrine," the Chief Judge had his contempt power to force the Sheriff to provide security. See In the Interest of J.E.S., 817 P.2d at 512.
A court's main concern is its own continuing viability. A court may exercise its inherent authority to further this goal. The Chief Judge ordered security to maintain the court's existence. If the Sheriff failed to provide security, the Chief Judge had his contempt power, another facet of a court's inherent authority, to enforce his order to the Sheriff to provide security for the Courthouse. By following this procedure a court confines itself to judicial matters and does not stray into territory properly administered by another branch of government. Based on these principles, we find that the Chief Judge properly ordered the Sheriff to provide Courthouse security. However, the Chief Judge exceeded his authority under the record before us in ordering the Board to pay the expense of the security measures.


*550 III
Accordingly, we affirm that part of the Chief Judge's order which requires the Sheriff to provide security, and we reverse that part of the order which requires the Board to pay for said security.
NOTES
[1]  We granted certiorari to review the following issues:

1. Whether the respondent incorrectly applied the legal authority when it ordered the Weld County Sheriff to provide full-time security to the Weld County Courthouse.
2. Whether the respondent incorrectly applied the legal authority when it ordered the Board of County Commissioners for Weld County to pay for the cost of full-time security at the Weld County Courthouse.
3. Whether the respondent incorrectly exercised its inherent powers when it entered the August 17, 1994, order.
[2]  C.A.R. 50(a) provides:

A writ of certiorari from the Supreme Court to review a case newly filed or pending in the court of appeals, before judgment is given in said court, may be granted upon a showing:
(1) That the case involves a matter of substance not heretofore determined by the Supreme Court of Colorado, or that the case if decided according to the relief sought on appeal involves the overruling of a previous decision of the Supreme Court; or
(2) That the Court of Appeals is being asked to decide an important state question which has not been, but should be, determined by the Supreme Court; or
(3) That the case is of such imperative public importance as to justify the deviation from normal appellate processes and to require immediate determination in the Supreme Court.
[3]  Section 13-1-114(2) provides:

(2) Any judge of any court, when he reasonably believes that there is a risk of violence in the court, shall immediately advise the law enforcement agency designated to provide security for the court, and the law enforcement agency shall determine and provide appropriate security measures consistent with the degree of risk present. For the purpose of this subsection (2), a district or county judge shall have the assistance of the county sheriff, and a municipal judge shall have the assistance of the municipal police department. The court shall have discretion to assess all or part of the expense incurred in implementing such security measures as costs to be paid by the party or parties or other person or persons determined by the court to have necessitated such security measures.
Section 13-1-114(2) provides specific authorization for any judge to obtain the assistance of the appropriate law enforcement agency to provide security for the court to address a particular situation. The language of this statute authorizes a judge to obtain the assistance of a law enforcement agency, in this case the Sheriff, to provide security in response to a perceived risk of violence. The law enforcement agency then determines what security measures would be appropriate, consistent with the degree of risk, and provides security measures necessary to counter the risk. However, because our inherent powers analysis controls the result of this case, we do not address in detail section 13-1-114(2) or the other statutes cited by the parties.
[4]  Article III of the Colorado Constitution states:

The powers of the government of this state are divided into three distinct departments,the legislative, executive and judicial; and no person or collection of persons charged with the exercise of powers properly belonging to one of these departments shall exercise any power properly belonging to either of the others, except as this constitution expressly directed or permitted.
