
556 N.W.2d 563 (1996)
S.J.S., a minor, by L.S., her mother and natural guardian, Appellants,
v.
FARIBAULT COUNTY et al., Respondents.
No. C6-96-566.
Court of Appeals of Minnesota.
December 3, 1996.
Review Denied January 21, 1997.
*564 Scott R.L. Christenson, Piper Law Firm, St. James, for Appellants.
Thomas P. Carlson, Ratwik, Roszak, & Maloney, P.A., Minneapolis, for Respondents.
Considered and decided by PETERSON, P.J., and KLAPHAKE and FORSBERG, JJ.[*]

OPINION
PETERSON, Judge.
Appellants argue the district court erred in determining that prosecutorial immunity and vicarious prosecutorial immunity protected respondents from appellants' claims under the Minnesota Government Data Practices Act. We affirm.

FACTS
When appellant S.J.S. was 15 years old, she disclosed in a treatment setting that she had been the victim of criminal sexual conduct. During a subsequent interview with the police, S.J.S. gave detailed descriptions of several incidents of criminal sexual conduct and identified C.H. as the perpetrator of some of these offenses. The police prepared a 36-page transcript of S.J.S.'s interview, which identified her by her full name. Only the first 13 pages of the transcript discussed criminal sexual conduct committed by C.H.
*565 Respondent Joel Welder, the Faribault County Attorney, discovered S.J.S.'s statement after he had filed charges against C.H. for third-degree criminal sexual conduct involving another juvenile. Welder obtained S.J.S.'s statement and then disclosed to C.H.'s lawyer that the state planned to call S.J.S., and another juvenile, to testify at C.H.'s trial about other acts of criminal sexual conduct that C.H. had committed. Welder suggested that if C.H. pleaded guilty to the charged offense, the state would not file charges in the cases involving S.J.S. and the other juvenile. When C.H.'s attorney asked for a copy of S.J.S.'s statement to evaluate the plea offer, Welder gave him the entire, unedited transcript. C.H.'s lawyer then gave C.H. a copy of the entire transcript. C.H. shared his copy of S.J.S.'s statement with his friends and kept it on the coffee table in his home.
S.J.S. discovered how the entire, unedited transcript had been given to C.H. when a sheriff's deputy and a county social worker apologized to her for the release of her statement. S.J.S., through her mother, then sued respondent Faribault County and Welder, claiming the release of her entire statement without an in camera review violated the Minnesota Government Data Practices Act. Appellants sought damages and attorney fees. S.J.S. said the release of the entire transcript had exposed her to harassment, forced her to change schools and to live away from her parents, and caused her significant emotional and psychological injury.
The district court granted respondents' motion to dismiss for failure to state a claim upon which relief can be granted. The district court determined that Welder had released S.J.S.'s statement while performing duties that were an integral part of the judicial process and that he therefore was protected from liability for appellants' claims by absolute prosecutorial immunity. The district court determined that Welder's absolute immunity extended vicariously to the county.

ISSUE
Do prosecutorial immunity and vicarious prosecutorial immunity protect Welder and the county from liability?

ANALYSIS
When reviewing a case dismissed for failure to state a claim upon which relief can be granted, the only question before us is whether the complaint sets forth a legally sufficient claim for relief. Elzie v. Commissioner of Pub. Safety, 298 N.W.2d 29, 32 (Minn.1980). If a claim is barred on immunity grounds, the governmental entity is entitled to judgment as a matter of law and dismissal is proper. Diedrich v. State, 393 N.W.2d 677, 680 (Minn.App.1986), review denied (Minn. Nov. 26, 1986).
The Minnesota Government Data Practices Act (MGDPA) provides that
a political subdivision [or] responsible authority * * * which violates any provision of this chapter is liable to a person * * * who suffers any damage as a result of the violation, and the person damaged * * * may bring an action against the political subdivision [or] responsible authority * * * to cover any damages sustained, plus costs and reasonable attorney fees.
Minn.Stat. § 13.08, subd. 1 (1994). Appellants sued Welder in his official capacity as county attorney acting as a responsible authority under the MGDPA.
Minnesota follows
the majority rule that public prosecutors, when acting within the scope of their duties by filing and maintaining criminal charges, are absolutely immune from civil liability.
Brown v. Dayton Hudson Corp., 314 N.W.2d 210, 214 (Minn.1981). Under the functional test used in Minnesota, the existence of prosecutorial "immunity depends upon the functional nature of the activities rather than upon the status of the prosecutor." Erickson v. County of Clay, 451 N.W.2d 666, 670 (Minn.App.1990).
[A] prosecutor does not have to defend prosecutorial mistakes if they occurred in the performance of a function inherent in the prosecutor's role as an advocate.
Id.
Appellants argue prosecutorial immunity is intended to protect a prosecutor only *566 from civil liability to former defendants in criminal cases brought by the prosecutor. Appellants claim that a prosecutor should not be absolutely immune to suit by innocent third parties such as S.J.S. But the vigorous and fearless performance of prosecutorial duties is essential to the proper functioning of the criminal justice system and, therefore, to the broader public interest. Brown, 314 N.W.2d at 213 (citing Imbler v. Pachtman, 424 U.S. 409, 427, 96 S.Ct. 984, 993, 47 L.Ed.2d 128 (1976)). The purpose of extending absolute immunity to prosecutors is to prevent the possibility that the risk of having to defend a lawsuit would deter a prosecutor from the fearless and vigorous performance of the prosecutorial function. Id. at 213 (citing Imbler, 424 U.S. at 423, 427, 96 S.Ct. at 991, 993).
The deterrent effect of the threat of litigation exists regardless of the plaintiff's status as a former criminal defendant or innocent third party. Thus, to ensure vigorous and fearless performance of the prosecutorial function, and thereby promote the broader public interest, absolute immunity must protect prosecutors from civil liability to any plaintiff for acts that occur in the performance of prosecutorial duties.
Appellants also argue that Welder released S.J.S.'s statement in response to a defense discovery request and that complying with defense discovery requests is not a function inherent in initiating or maintaining a criminal action. We disagree. Complying with discovery requests is an integral part of the prosecutor's adversarial role and a function inherent in maintaining criminal actions. See Imbler, 424 U.S. at 413-15, 430, 96 S.Ct. at 987, 995 (prosecutor's alleged suppression of exculpatory evidence was activity intimately associated with judicial phase of criminal process and thus was function protected by prosecutorial immunity); White v. Moulder, 30 F.3d 80, 83 (8th Cir.1994) (prosecutor's failure to produce evidence favorable to defense falls within functions protected by prosecutorial immunity), cert. denied, ___ U.S. ___, 115 S.Ct. 738, 130 L.Ed.2d 641 (1995). Consequently, Welder is absolutely immune for releasing S.J.S.'s statement without in camera review in response to a defense discovery request.
The policy considerations that support extending absolute immunity to prosecutors also support extending absolute immunity vicariously to the county. Brotzler v. County of Scott, 427 N.W.2d 685, 691 (Minn. App.1988), review denied (Minn. Sept. 16, 1988). Here, the threat of litigation against the county for disclosures made in response to defense discovery requests could deter prosecutors from vigorously and fearlessly performing their duties. Accordingly, we extend the absolute immunity enjoyed by Welder in this case vicariously to the county. See S.L.D. v. Kranz, 498 N.W.2d 47, 51-53 (Minn. App.1993) (official immunity extended vicariously to government employer when threat of liability against employer would unduly influence employees from exercising independent judgment in pursuit of legitimate public policy choices).
Given our decision on the immunity issue, we need not address the other issues raised by the parties.

DECISION
Absolute prosecutorial immunity protected Welder from civil liability to appellants under the Minnesota Government Data Practices Act for releasing S.J.S.'s statement without in camera review in response to a defense discovery request because this activity was a function inherent in initiating and maintaining a criminal action. Because the threat of litigation against the county for disclosures made in response to defense discovery requests would deter the vigorous and fearless performance of this prosecutorial duty, the absolute immunity that applies to Welder must be extended vicariously to the county.
Affirmed.
NOTES
[*]  Retired judge of the Minnesota Court of Appeals, serving by appointment pursuant to Minn. Const. art. VI, § 10.
