The petitioners, Cynthia Davis and Su~ zann Isaacs, are Jefferson County sheriffs deputies who claim sovereign immunity in a wrongful-death action brought against them and others1 by the estate of Natasha Lee (“the estate”), by and through its personal representative David N. Cutchen. On October 23, 2006, the trial court granted Davis and Isaacs’s motion to dismiss the complaint against them based on the doctrine of sovereign immunity and gave the estate 21 days to file an amended complaint. The estate filed an amended complaint on November 13, 2006, which included a wrongful-death claim and a 42 U.S.C. § 1983 claim alleging deliberate indifference to Lee’s serious medical needs. Davis and Isaacs again moved for a dismissal, arguing that the amended complaint, filed more than two years after Lee’s death, is time-barred and could not relate back to the initial complaint, which had been dismissed as to Davis and Isaacs on the basis of sovereign immunity. Sovereign immunity is a jurisdictional bar and, Davis and Isaacs argue, the trial court had no authority to do anything with the initial complaint other than to dismiss it, i.e., it had no authority to allow the estate 21 days to file an amended complaint. The trial court denied their motion to dismiss, and Davis and Isaacs petitioned this Court for a writ of mandamus ordering the trial court to dismiss the wrongful-death action and the § 1983 claim asserted against them in the amended complaint. This Court ordered answer and briefs, and after examining the answer and briefs, we now grant the petition and issue the writ of mandamus.
*482 I. Background
Lee, a 32-year-old female, was placed in the Jefferson County jail on March 19, 2004, where she was being held pending the hearing of federal charges against her in the United States District Court for the Northern District of Alabama. The estate alleges that Lee’s medical records, the information provided during the intake and screening, and other documentation in her medical file contain multiple references to the fact that Lee suffered from Graves’ disease and other disorders and that she required medication for these conditions. The medications she had been taking include propylthiouracil (“PTU”), atenolol, Inderal, Prozac, and trazadone.
Lee’s prescription for PTU, which she was to take orally three times daily for seven days, ran out on or about April 9, 2004, and was not reordered, refilled, re-prescribed, or administered to Lee after that date. Lee was released from the jail on April 22, 2004. She was admitted to the University of Alabama at Birmingham hospital on April 26, 2004, after complaining of chest pain and becoming unresponsive; she died at the hospital on that same date. The autopsy findings of the Jefferson County medical examiner’s office state that the cause of death was a “thyroid storm” due to Graves’ disease. Blood taken upon Lee’s admission to the University of Alabama at Birmingham hospital reflects that Lee had no PTU in her blood at the time of her death.
The estate claims that Davis, Isaacs, and the other defendants were responsible for Lee’s physical care because they had incarcerated her and prevented her from obtaining medical treatment on her own, that they were aware of Lee’s medical condition, that they provided no medical care for Lee and did not allow her to obtain medical care, and that their failure to provide medical care or allow her to obtain medical care constitutes willful and wanton misconduct and violation of a duty imposed upon sheriffs and jailers by Ala. Code 1975, § 14-6-19. The estate alleges that on March 20, 2004, the day after Lee’s admission to the jail, Davis entered the D Block on Level 5 of the jail to perform a head count, that she found Lee lying on the floor, that she asked Lee what was wrong, and that Lee told Davis that she did not feel well, that she had Graves’ disease, and that she needed her medication. Davis then transferred Lee to the medical block and informed someone on the medical staff that Lee had told her she had Graves’ disease and needed her medication.
Davis and Isaacs claim that they are immune from this action under § 14 of the Alabama Constitution of 1901. They deny that they were negligent in any respect as to Lee’s custody and her treatment while in custody. They admit that Lee told them that she suffered from Graves’ disease, but they assert that they had no further knowledge of Lee’s medical condition, that they had no knowledge about Graves’ disease or about any medications used to treat Graves’ disease, that they have no medical training except basic first aid and CPR, and that they are prohibited by regulations applicable to the jail (Corrections Division Manual of General Orders §§ 4-1, 4-9, and 4-11) and by state law (Ala.Code 1975, §§ 34-24-51, 34-24-50, and 34-23-50) and federal law (the Health Insurance Portability and Accountability Act of 1996, Pub.L. No. 104-191) from accessing prisoners’ medical records or giving medications to prisoners.
II. Standard of Review
“ ‘A writ of mandamus is an extraordinary remedy that requires the showing of: (1) a clear legal right in the petitioner to the order sought; (2) an *483imperative duty on the respondent to perform, accompanied by a refusal to do so; (3) the lack of another adequate remedy; and (4) the properly invoked jurisdiction of the court.’ Ex parte McNaughton, 728 So.2d 592, 594 (Ala.1998).”
Ex parte State Farm Mut. Auto. Ins. Co., 761 So.2d 1000, 1002 (Ala.2000). “It is well established that mandamus will lie to compel a dismissal of claim that is barred by the doctrine of sovereign immunity.” Ex parte Blankenship, 893 So.2d 303, 305 (Ala.2004) (citing Ex parte McWhorter, 880 So.2d 1116, 1117 (Ala.2003)). “ ‘Mandamus review- is available when the question presented is one of subject-matter jurisdiction.’ ” Ex parte Richardson, 957 So.2d 1119, 1124 (Ala.2006) (quoting Ex parte Chemical Waste Mgmt, Inc., 929 So.2d 1007, 1010 (Ala.2005)).
III. Analysis
Article I, § 14, Alabama Constitution of 1901, states simply: “[T]he State of Alabama shall never be made a defendant in any court of law or equity.” Although counties do not necessarily possess the same sovereign immunity as do states and state agencies, county sheriffs are executive officers of the State of Alabama and are therefore immune from liability for actions taken in executing the duties of their offices. Boshell v. Walker County Sheriff, 598 So.2d 843, 844 (Ala.1992). This Court has also recognized that a “deputy sheriff is afforded the same immunity from suit as a sheriff in regard to claims for monetary damages stemming from activities performed while working in the line and scope of his or her employment.” Ex parte Purvis, 689 So.2d 794, 796 (Ala.1996).
When Lee was in custody in the Jefferson County jail, Davis and Isaacs were acting within the line and scope of their employment while guarding the prisoners in the county jail. They were prohibited from prescribing or dispensing medications; those services were the contractual responsibility of the medical-service providers for the jail. Davis and Isaacs are therefore immune from liability for the estate’s wrongful-death claim because of the sovereign immunity afforded them by § 14, Alabama Constitution of 1901. The trial court therefore appropriately dismissed the wrongful-death claim against them in the original complaint.
The issue raised in this mandamus petition is whether the trial court then erred in allowing the estate to file an amended complaint including a new wrongful-death count and a 42 U.S.C. § 1983 count after the original complaint had been dismissed on the ground of sovereign immunity and the statute of limitations on the claims asserted in the amended complaint had expired. We conclude that the trial court did err in allowing the estate to file an amended complaint.
After the original complaint was dismissed as to Davis and Isaacs on October 23, 2006, the estate filed an amended complaint on November 13, 2006, more than two and one-half years after Lee’s death on April 26, 2004, that stated two new causes of action against Davis and Isaacs. The new wrongful-death claim against Davis and Isaacs is barred by § 14, Alabama Constitution of 1901, just like the original wrongful-death claim that was dismissed by the trial court.
Because the original complaint purported to state a cause of action against Davis and Isaacs in violation of § 14, Alabama Constitution of 1901, the trial court did not acquire subject-matter jurisdiction over the claims against the deputies when the original complaint was filed. Ex parte Blankenship, 893 So.2d 303, 306-07 (Ala. *4842004). Thus, when the amended complaint was filed, the newly asserted § 1983 claim against Davis and Isaacs was time-barred by the applicable two-year statute of limitations:
“(l) All actions for any injury to the person or rights of another not arising from contract and not specifically enumerated in this section must be brought within two years.”
§ 6-2-38(0; Gorman v. Wood, 663 So.2d 921, 922 (Ala.1995) (“[T]he only statute of limitations applicable to § 1983 claims in Alabama is the two-year statute of limitations in Ala.Code 1975, § 6 — 2—38(Z ).”).
Therefore, Davis and Isaacs’s motion to dismiss was due to have been granted.
IV. Conclusion
For the above-stated reasons, we grant the petition and issue the writ of mandamus; the trial court is directed to dismiss the amended complaint against Davis and Isaacs.
PETITION GRANTED; WRIT ISSUED.
COBB, C.J., and SEE, LYONS, WOODALL, STUART, SMITH, and BOLIN, JJ., concur. MURDOCK, J., concurs in the result.. Other named defendants sued by the estate, but not at issue in this petition, included the Jefferson Metropolitan Healthcare Authority, Prison Health Services, 3 doctors, and at least 10 nurses.