
176 Cal.App.4th 380 (2009)
THE PEOPLE, Plaintiff and Respondent,
v.
ALEJANDRO MIGUEL PEREZ, Defendant and Appellant.
No. B213114.
Court of Appeals of California, Second District, Division Six.
August 4, 2009.
*382 Duane A. Dammeyer, Public Defender, Michael C. McMahon, Chief Deputy Public Defender, for Defendant and Appellant.
Edmund G. Brown, Jr., Attorney General, Pamela C. Hamanaka, Assistant Attorney General, Susan Sullivan Pithey and Julie A. Harris, Deputy Attorneys General, for Plaintiff and Respondent.

OPINION
GILBERT, P. J.
Alejandro Miguel Perez pleaded guilty to second degree robbery. (Pen. Code, § 211.) His appeal concerns a single condition of probation imposed at his sentencing hearing that prohibits him from attending any court hearing or being "within 500 feet of any Court in which [he] is neither a defendant nor under subpoena." Under the circumstances here, we conclude the probation condition is overbroad. We strike the probation condition and remand with instructions.

FACTS
Perez and his friends saw a young man named Luis near a store. Perez believed Luis was an El Rio gang member. Luis had just bought a pair of pants for $29. Perez and his friends confronted Luis and exchanged unfriendly words. Perez tackled Luis and "then forcibly took his pants to make a point."
Perez said that he believed that Luis and others had vandalized his brother's property. He took the pants in retaliation for what had happened to *383 his brother, and he was "sorry for what he did to" Luis. Perez said some of his friends are Colonia Chiques gang members, but "he never joined their gang." He "tagged" for the La Colonia gang, however, and belonged to a graffiti "tagging crew called VC Tag."
After Perez pleaded guilty to second degree robbery, the trial court suspended imposition of sentence and placed him on 36 months of formal felony probation.
The probation report lists 36 probation terms and conditions. Probation condition 23 provides, "The defendant shall not attend any Court hearing or be within 500 feet of any Court in which the defendant is neither a defendant nor under subpoena. The defendant shall inform the probation officer prior to any Court appearance."
The prosecutor requested the court to impose all probation conditions listed in the probation report.
Perez's counsel moved the court to strike condition 23 as "an illegal term" and noted that in a prior appeal this court struck this same condition. (People v. Leon (Apr. 19, 2007, B190806) [nonpub. opn.].) The trial court denied the motion.

DISCUSSION
(1) "In granting probation, courts have broad discretion to impose conditions to foster rehabilitation and to protect public safety ...." (People v. Carbajal (1995) 10 Cal.4th 1114, 1120 [43 Cal.Rptr.2d 681, 899 P.2d 67].) "The trial court's discretion, although broad, nevertheless is not without limits." (Id. at p. 1121.) A probation condition that is unreasonable or overbroad will not be sustained. (Ibid.; In re John V. (1985) 167 Cal.App.3d 761, 770-771 [213 Cal.Rptr. 503].) A condition that "forbids conduct which is not itself criminal" must be "reasonably related to the crime of which the defendant was convicted or to future criminality." (People v. Lent (1975) 15 Cal.3d 481, 486 [124 Cal.Rptr. 905, 541 P.2d 545].)
Perez claims that a 500-foot restriction on access to courts is not reasonably related to his crime. His offense did not involve threatening witnesses or interfering with court proceedings. Because of Perez's affiliation with gangs, the Attorney General justifies the restriction to prevent future gang-related criminality.
(2) A trial court may impose probation conditions to discourage defendants from engaging in gang-connected activities. (People v. Lopez (1998) 66 *384 Cal.App.4th 615, 625-626 [78 Cal.Rptr.2d 66].) Here there were a number of "gang" probation conditions: Perez may not associate with gang members, be near gang areas or activities, wear gang clothing, display gang-related items, or associate with graffiti taggers. Perez does not contest these conditions.
(3) Trial courts also may impose conditions to protect witnesses, parties to court proceedings, and court personnel. (Townsel v. Superior Court (1999) 20 Cal.4th 1084, 1097 [86 Cal.Rptr.2d 602, 979 P.2d 963]; People v. Ponce (2009) 173 Cal.App.4th 378, 384-385 [92 Cal.Rptr.3d 667]; People v. Jungers (2005) 127 Cal.App.4th 698, 705 [25 Cal.Rptr.3d 873].) Condition 23 however is not limited to protecting specific witnesses or parties, nor is it confined to trials involving gang members. It is so broad that it restricts Perez from engaging in activities that are unrelated to future criminality.
(4) "A probation condition that imposes limitations on a person's constitutional rights must closely tailor those limitations to the purpose of the condition to avoid being invalidated as unconstitutionally overbroad." (In re Sheena K. (2007) 40 Cal.4th 875, 890 [55 Cal.Rptr.3d 716, 153 P.3d 282].) A court may not issue broad restraints on liberty that are completely unrelated to the defendant's crime, conduct and future criminality, without a showing justifying the need for the restriction. (Bitter v. United States (1967) 389 U.S. 15, 16 [19 L.Ed.2d 15, 88 S.Ct. 6]; People v. Ponce, supra, 173 Cal.App.4th at p. 384.)
Here the prosecution did not provide a rationale for the 500-foot court access restriction. It did not claim that Perez had loitered on courthouse property, that he had threatened or would threaten witnesses, or that his presence in a courthouse would incite violence. At the sentencing hearing, the prosecutor simply said, "I just think the Court should impose all the probation terms. Submitted."
(5) The Attorney General has not shown why a narrower condition restricting attendance at trials of gang members and prohibiting contact with witnesses would not suffice. A narrow condition that achieves rehabilitation should be used in place of broad conditions that prevent otherwise lawful conduct and necessary activities. (In re John V., supra, 167 Cal.App.3d at pp. 770-771.) "[A] condition of probation which prohibits conduct which is not only legal, but protected by the Constitution and not related to the crimes of which a defendant has been convicted, nor to future criminality, cannot stand." (People v. Arvanites (1971) 17 Cal.App.3d 1052, 1063-1064 [95 Cal.Rptr. 493].)
Consequently, courts have struck conditions that are so broad they prevent lawful conduct in public places: going to restaurants, parks or zoos (In re *385 White (1979) 97 Cal.App.3d 141, 144 [158 Cal.Rptr. 562]); conversing on public streets (People v. Norris (1978) 88 Cal.App.3d Supp. 32, 42 [152 Cal.Rptr. 134]); disseminating leaflets (People v. Arvanites, supra, 17 Cal.App.3d at p. 1063); or engaging in political protests (United States v. Soltero (9th Cir. 2007) 510 F.3d 858, 867).
(6) Perez claims that because of its broad language and the 500-foot court access barrier, condition 23 imposes unnecessary restrictions on his right to access the courts and government offices. We agree. (7) "[T]he United States Supreme Court has long recognized a constitutional right of access to the courts for all persons, including prisoners." (Payne v. Superior Court (1976) 17 Cal.3d 908, 914 [132 Cal.Rptr. 405, 553 P.2d 565].) Indeed, such persons and those accused of crimes may be more in need of access to the courts than most people. (See Tennessee v. Lane (2004) 541 U.S. 509, 532 [158 L.Ed.2d 820, 124 S.Ct. 1978]; Wantuch v. Davis (1995) 32 Cal.App.4th 786, 792 [39 Cal.Rptr.2d 47].) In setting probation conditions, courts should not erect unnecessary barriers that impede the right of lawful and necessary access to the courts to file and pursue civil litigation. (State v. Donovan (1989) 307 Ore. 461 [770 P.2d 581, 584].) "Public safety is not threatened if defendant seeks court action.... Nor is barring such recourse a proper means of rehabilitation." (Id., 770 P.2d at p. 584.) Here condition 23 could prevent Perez from filing or appearing in a civil action or voluntarily testifying in a case in which he has not been subpoenaed.
In addition, broad and unnecessary exclusions from either government centers that invite public participation or public places that contain parks and other public forums touch upon other constitutionally protected interests. (Perry Ed. Assn. v. Perry Local Educators' Assn. (1983) 460 U.S. 37, 45 [74 L.Ed.2d 794, 103 S.Ct. 948]; Marsh v. Alabama (1946) 326 U.S. 501, 506 [90 L.Ed. 265, 66 S.Ct. 276]; Young v. Municipal Court (1971) 16 Cal.App.3d 766, 768-771 [94 Cal.Rptr. 331]; In re Cox (1970) 3 Cal.3d 205, 217 [90 Cal.Rptr. 24, 474 P.2d 992]; In re Hoffman (1967) 67 Cal.2d 845, 850-851 [64 Cal.Rptr. 97, 434 P.2d 353].) Unreasonable restrictions "on access to public property" contravene the First Amendment. (Dallas Assn. etc. v. Dallas County Hospital Dist. (5th Cir. 1982) 670 F.2d 629, 632.)
Many courts are located in government complexes that house a variety of public agencies. These may include a county law library; a public defender's office; a hall of administration, housing a board of supervisors, a city council, or both; a tax collector; and a health department, to name a few.
Other jurisdictions have imposed court access restrictions that still allow a defendant's access to government offices and public places. In State v. Setzer (1978) 35 N.C.App. 734 [242 S.E.2d 509, 510-511], a defendant was *386 convicted of breaking into a courthouse, and as a probation condition, he could not loiter on courthouse property. There was an obvious nexus between the defendant's crime and the probation condition. But, even there, the appellate court noted that the condition contained an exception that allowed the defendant to be on courthouse grounds for legitimate business. Other cases also hold that even where probation access restrictions are appropriate, "provision should be made to allow for lawful travel through the area of restriction and for access to the area for legitimate purposes ...." (Oyoghok v. Municipality of Anchorage (Alaska Ct.App. 1982) 641 P.2d 1267, 1270, fn. 4, italics added; see In re White, supra, 97 Cal.App.3d at p. 150; In re J.W. (2003) 204 Ill.2d 50 [272 Ill.Dec. 561, 787 N.E.2d 747, 765]; see also State v. Churchill (1983) 62 N.C.App. 81 [302 S.E.2d 290, 293] [probation provision restricting defendant's access to a transportation facility was valid because "[t]he court allowed defendant access to the terminal premises for the legitimate business purpose of traveling by bus"].)
We strike probation condition 23 and remand the matter to the trial court. The court may impose a narrower condition if it deems necessary. In all other respects, we affirm the judgment.
Yegan, J., and Coffee, J., concurred.
