
656 So.2d 382 (1995)
Ex parte JEFFERSON COUNTY.
(Re Jeffrey HOPE, et al. v. CITY OF HUEYTOWN, et al.).
1930829.
Supreme Court of Alabama.
February 24, 1995.
*383 Charles S. Wagner, Birmingham, for petitioner.
G. Daniel Evans, Birmingham, for respondents.
KENNEDY, Justice.
Jefferson County seeks a writ of mandamus ordering the Honorable William J. Wynn, Circuit Judge, Tenth Judicial Circuit of Alabama, to dismiss all claims stated against it, on the basis of the doctrine of res judicata and on the grounds that it cannot be held liable on a respondeat superior basis for the acts or omissions of a county sheriff or the sheriff's deputy.
The facts underlying this petition are as follows: The plaintiff Jeffrey Hope is a police officer employed by the City of Hueytown. On June 6, 1991, while Hope was at work, the Multi-Agency Drug Enforcement Team ("M.A.D.E.T.") executed a search warrant at Hope's apartment. The warrant authorized a search for "cocaine, drug paraphernalia, and other evidence of drug activity."
Hope's wife and child were inside the apartment when the police arrived. The police searched the apartment and Hope's automobile. The police also searched Hope's wife and child. No evidence of any illegal substance or drug paraphernalia was found.
Hope and his wife sued the City of Hueytown, the City of Pleasant Grove, Jefferson County, M.A.D.E.T., and six individual law enforcement officers involved in the search, including a Jefferson County deputy sheriff. The Hopes brought their action in the United States District Court for the Northern District of Alabama, claiming federal law violations and making state law claims. Shortly after service was perfected on the defendants, the Hopes served interrogatories and requested depositions, admissions, and production of documents. Jefferson County responded to the requests by stating that it could not answer any questions or produce any documents because, it said, it had no knowledge of the day-to-day operations of the sheriff's office. The federal court then stayed all discovery.
Jefferson County filed a "motion to dismiss, [or] alternatively, a motion for summary judgment." Jefferson County claimed that the Hopes had failed to state a claim *384 upon which relief could be granted, arguing that it could not be held responsible for the activities of the Jefferson County sheriff or any of his deputies. Attached to the motion was an affidavit by the president of the Jefferson County Commission, Mary Buckelew. Buckelew stated in the affidavit that the Jefferson County Commission merely provides funds for the sheriff's office and that neither the commission nor any individual commissioner has any authority or control over the activities of the office.
The federal court entered orders in favor of all defendants. Specifically, the federal court entered a summary judgment in favor of Jefferson County. In its summary judgment order, the court said:
"[T]he plaintiffs' claims [including any state law claims before the court pursuant to supplemental jurisdiction] against the county must fail because Jefferson County had no legal authority to exercise any direction or control over the actions of any of the individual defendants or the governmental agencies for which they worked.... Presumably, plaintiffs intend to assert county liability based upon the actions of defendant Michael Saxon, a deputy sheriff [of Jefferson County]. That theory, if that is what the plaintiffs rely on, will not aid them because a deputy sheriff is not an agent of the county in which he serves. Rather, he is the alter ego of the sheriff who appointed him and to whom he is responsible.... The state claims against Jefferson County, like the federal claims, depend for their vitality upon the authority of the county to control or direct the activities of deputy Saxon. There is none...."
We note here that the Hopes contend that the federal court refused to exercise jurisdiction over the state law claims and that their action against Jefferson County based on state law claims is not barred. However, the orders attached as part of the briefs filed by the Hopes and by Jefferson County show otherwise. On October 15, 1993, the federal court specifically asserted jurisdiction over the state law claims against Jefferson County, pursuant to 28 U.S.C. 1367. In that order, it entered a summary judgment in favor of Jefferson County, finding that no genuine issue of material fact existed.
The Hopes cite an order dated November 15, 1993, wherein the federal court did not assert jurisdiction over certain state claims with regard to the City of Hueytown, John Taylor, the City of Pleasant Grove, Melvin Dale Smith, A.J. Knight, Bill Waites, and Deputy Michael Saxon. The defendant Jefferson County was not addressed in the order dated November 15, 1993, because it had already received a summary judgment. Therefore, the Hopes' claim that the federal court refused to exercise jurisdiction over the state law claims is without merit.
On December 15, 1993, the Hopes sued in the Circuit Court of Jefferson County, alleging certain state law claims against Jefferson County and other defendants. Jefferson County moved to dismiss, based on the doctrine of res judicata and claiming that it did not control the actions of the sheriff's office. The trial court denied the motion, stating: "As to the defendant Jefferson County's motion to dismiss, after reviewing the record, it appears that the dismissal of said defendant in Federal Court, prior to plaintiff's opportunity to take any discovery, [amounts] to the denial of the right to trial by jury. Such dismissal was clearly violative of the Constitution of the State of Alabama...."
Jefferson County now petitions this Court for a writ of mandamus ordering the trial court to dismiss all claims against it.
Mandamus is a drastic and extraordinary writ, to be issued only where there is a clear legal right in the petitioner to the order sought, an imperative duty upon the respondent to perform, a lack of another adequate remedy, and properly invoked jurisdiction of the court. Water Works & Sewer Board of the City of Birmingham v. Shelby County, 624 So.2d 1047 (Ala.1993).
Jefferson County argues that the state court action is barred by the doctrine of res judicata. The elements of res judicata are: (1) a prior judgment on the merits; (2) rendered by a court of competent jurisdiction; (3) substantially the same parties involved in the prior case are involved in the current case; and (4) the same cause of *385 action presented in both suits. Smith v. Scott Paper Co., 620 So.2d 976 (Ala.1993), cert. denied, ___ U.S. ___, 114 S.Ct. 189, 126 L.Ed.2d 148 (1993).
The issue in this case is whether there was a prior judgment on the merits. Jefferson County contends that the federal court's summary judgment in its favor amounted to a judgment on the merits, for the purposes of the doctrine of res judicata. According to the Federal Rules of Civil Procedure, a summary judgment shall be entered if the "pleadings, depositions, answers to interrogatories, and admissions on file, together with the affidavits, if any, show that there is no genuine issue of material fact and that the moving party is entitled to a judgment as a matter of law." F.R.Civ.P. 56(c).
A summary judgment acts as a judgment on the merits. Robinson v. Holley, 549 So.2d 1 (Ala.1989). A prior judgment in favor of the defendant bars the plaintiff from relitigating any matter that could have been litigated in the prior action. McCorkle v. McElwey, 576 So.2d 202 (Ala.1991). The Hopes are barred from litigating these same claims in state court, because the federal court has previously entered a judgment on the merits. Any argument by the Hopes that the summary judgment was wrongfully entered should have been addressed by the Hopes in an appeal from that summary judgment.
Because there has been a prior adjudication on the merits, rendered by a court of competent jurisdiction, with substantially the same parties involved, and with the same claims presented, the Circuit Court of Jefferson County is directed to dismiss Jefferson County, with prejudice, from the action now pending before it, CV-93-009669.
WRIT GRANTED.
HORNSBY, C.J., and MADDOX, SHORES, HOUSTON, COOK and BUTTS, JJ., concur.
