
595 S.E.2d 319 (2004)
265 Ga. App. 692
ROBINSON
v.
BECKER.
No. A03A2524.
Court of Appeals of Georgia.
January 15, 2004.
Reconsideration Denied February 19, 2004.
Certiorari Denied June 7, 2004.
James N. Finkelstein, Albany, for appellant.
Thurbert E. Baker, Atty. Gen., Kathleen M. Pacious, Deputy Atty. Gen., John C. Jones, Senior Asst. Atty. Gen., for appellee.
*320 RUFFIN, Presiding Judge.
Velma Louise Robinson sued Superior Court Judge Cynthia J. Becker for libel and civil rights violations. Judge Becker moved to dismiss on several grounds, including that Robinson's claims were barred by judicial immunity. The trial court granted Judge Becker's motion to dismiss. Robinson appeals, and for reasons that follow, we affirm.
When considering a motion to dismiss, a court must construe the pleadings in a light most favorable to the nonmoving party.[1] "Dismissal may only be granted if the allegations in the complaint disclose with certainty that the plaintiff would not be entitled to relief under any state of facts that could be proved in support of the claim."[2]
Viewed in this manner, Robinson's complaint alleged that, on June 18, 2002, Judge Becker entered an order barring her from the Dougherty County courthouse. According to the June 18 order, which Robinson attached to her complaint, Judge Becker was then presiding over the State of Ga. v. Sidney Dorsey criminal trial.[3] The order, which was styled In re Velma Robinson, but referenced the Dorsey case name and number, stated:
[W]hile presiding over [State v. Dorsey], the court received evidence that VELMA ROBINSON, a citizen of Dougherty County, has a history of tampering with at least one prior jury serving Dougherty County. Because the Defendant's Sixth Amendment right to a fair trial is at stake, the Court has considered and weighed such evidence and hereby finds that there is a reasonable likelihood that the Defendant's Sixth Amendment right to a fair trail (sic) may be prejudiced by jury tampering if VELMA ROBINSON is allowed at or near the court house during the pendency of this case.
Through the order, Judge Becker prohibited Robinson from coming within one block of the Dougherty County courthouse and forbade her from contacting jurors in the case. The order also provided that any violation would subject Robinson to contempt proceedings. Judge Becker signed the order as "Judge."
On June 25, 2002, Judge Becker entered a second order, also attached to Robinson's complaint, setting a hearing on Robinson's motion to vacate the June 18, 2002 order.[4] The second order reiterated that Robinson "[had] a history of tampering with at least one prior jury serving Dougherty County." Thus, the order explained, the court had "barred [Robinson] from within one block of the Dougherty County courthouse during the pendency of the case of State v. Sidney Dorsey, 02 CR 1519-6." Judge Becker signed this second order, which was styled In re Velma Robinson, as "Judge."
Based on these two orders, Robinson asserted in her complaint that Judge Becker libeled her. She further alleged that the ordersand Judge Becker's banviolated her civil rights, in contravention of 42 USC 1983. Judge Becker subsequently moved to dismiss Robinson's complaint, arguing that judicial immunity protected her from the suit. The trial court granted the motion and denied Robinson's competing motion for summary judgment.
"Our courts have consistently held that judges are immune from liability in civil actions for acts performed in their judicial capacity."[5] Such immunity allows judges "to exercise within their lawful jurisdiction untrammeled determination without apprehension of subsequent damage suits."[6] Citing *321 the United States Supreme Court, we have noted that "[a] judge will not be deprived of immunity because the action he took was in error, was done maliciously, or was in excess of his authority; rather, he will be subject to liability only when he has acted in the clear absence of all jurisdiction."[7]
Judicial immunity protects judges against state law claims, as well as civil rights actions brought under 42 USC § 1983.[8] This immunity does not apply, however, in two circumstances: (1) when the judge commits a nonjudicial act, or an act not taken in the judge's judicial capacity, and (2) when the judge acts in a judicial capacity, but completely without jurisdiction.[9] On appeal, Robinson asserts that she played no role in the State v. Dorsey criminal trial, had never been involved in any proceeding before Judge Becker, and was not in the Dorsey courtroom when she received the June 18 order. She argues, therefore, that Judge Becker had no jurisdiction over her, lacked authority to ban her from the courthouse, and is not entitled to judicial immunity.
We disagree. "[W]hether an act by a judge is a `judicial' one relates to the nature of the act itself, i.e., whether it is a function normally performed by a judge, and to the expectations of the parties, i.e., whether they dealt with the judge in his judicial capacity."[10] As stated in the June 18, 2002 order, Judge Becker enjoined Robinson's conduct in an effort to protect Sidney Dorsey's right to a fair trial. Undoubtedly, safeguarding a criminal defendant's rights is a function normally performed by a trial judge.[11] A trial court also is authorized "[t]o preserve and enforce order in its immediate presence and, as near thereto as is necessary, to prevent interruption, disturbance, or hindrance to its proceedings."[12] Finally, Judge Becker entered the orders in her capacity as the presiding judge in State v. Dorsey, and the parties to that proceeding certainly dealt with her in her judicial capacity. Under these circumstances, we agree with the trial court that Judge Becker engaged in a "judicial act" when she issued the June 18, 2002 and June 25, 2002 orders.[13]
We further find that Judge Becker acted within her jurisdiction when entering the orders. In her complaint, Robinson asserted that Judge Becker had no personal jurisdiction over her. She also claimed that Judge Becker "lacked subject matter jurisdiction" to regulate conduct outside of the Dorsey courtroom. Without dispute, however, Judge Becker had jurisdiction over State v. Dorsey when she entered the orders, which specifically enjoined Robinson's actions with respect to that criminal trial. Moreover, Judge Becker was authorized to control activities both inside and, where necessary, outside the courtroom to prevent disturbance to the criminal proceedings.[14]
The key question is not whether Judge Becker had personal jurisdiction over Robinson, but whether Judge Becker had jurisdiction over the subject matterhere, the Dorsey proceedings.[15] She clearly had such jurisdiction. Thus, even assuming, without deciding, that Judge Becker exceeded her authority by banning Robinson from all areas *322 within one block of the courthouse or by imposing the ban without first holding a hearing, we cannot conclude that she acted entirely outside of her jurisdiction.[16]
Regardless of whether Judge Becker went too far in restraining Robinson's conduct, she committed a judicial act that was not "in the clear absence of all jurisdiction."[17] Accordingly, Judge Becker is judicially immune from this civil suit, and the trial court properly dismissed Robinson's complaint.[18]
Judgment affirmed.
SMITH, C.J., and MILLER, J., concur.
NOTES
[1]  See Kelly v. Lewis, 221 Ga.App. 506, 507, 471 S.E.2d 583 (1996).
[2]  Id.
[3]  Although Judge Becker is a DeKalb County Superior Court judge, and the State originally filed criminal charges against Dorsey there, venue for the trial was transferred to Dougherty County.
[4]  The two orders at issue do not directly follow the complaint in the record, but Robinson alleged that she attached them, and neither party disputes that the orders form part of the complaint.
[5]  (Punctuation omitted.) Maddox v. Prescott, 214 Ga.App. 810, 812(1), 449 S.E.2d 163 (1994).
[6]  (Punctuation omitted.) Id. at 813, 449 S.E.2d 163
[7]  (Punctuation omitted.) Chamberlain v. Thompson, 165 Ga.App. 807, 808, 302 S.E.2d 721 (1983).
[8]  See Stump v. Sparkman, 435 U.S. 349, 356, 98 S.Ct. 1099, 55 L.Ed.2d 331 (1978) (doctrine of judicial immunity applies to § 1983 claims); Chamberlain, supra (judge immune from suit alleging false arrest and malicious prosecution).
[9]  See Mireles v. Waco, 502 U.S. 9, 11-12, 112 S.Ct. 286, 116 L.Ed.2d 9 (1991).
[10]  (Punctuation omitted.) Id. at 12, 112 S.Ct. 286.
[11]  See Carson v. State, 264 Ga.App. 763, 765, 591 S.E.2d 500 (2003) ("It is the responsibility of the trial court to ensure that the system is not manipulated by any party, while protecting the defendant's constitutional and statutory rights.").
[12]  OCGA § 15-1-3(1).
[13]  See Mireles, supra; Simmons v. Conger, 86 F.3d 1080, 1085 (11th Cir.1996) (trial judge acted in his judicial capacity when he excluded a spectator from the courtroom).
[14]  See OCGA § 15-1-3.
[15]  See Stump, supra at 356, n. 6, 98 S.Ct. 1099; Hill v. Bartlett, 126 Ga.App. 833, 837-838(1), 192 S.E.2d 427 (1972).
[16]  See Mireles, supra at 13, 112 S.Ct. 286; Simmons, supra.
[17]  (Punctuation omitted.) Chamberlain, supra.
[18]  Although the trial court apparently did not base its dismissal of Robinson's civil rights claim on judicial immunity, we will affirm a judgment that is right for any reason. See Precise v. City of Rossville, 261 Ga. 210, 211(3), 403 S.E.2d 47 (1991).
