
781 So.2d 936 (2000)
Ex parte CITY OF GADSDEN.
(Re Shirley McDonough v. Margaret Denise Parker et al.)
1981366.
Supreme Court of Alabama.
July 21, 2000.
Rehearing Denied October 13, 2000.
*937 Vann A. Spray of Ford & Howard, P.C., Gadsden, for petitioner.
Gary J. Bone, Gadsden, for respondent Shirley McDonough.
Curtis Wright of Dortch, Wright & Wright, Gadsden, for respondent Kandralyn S. Johnson.
BROWN, Justice.
The City of Gadsden ("the City"), a defendant in an action pending in the Etowah Circuit Court, petitions for a writ of mandamus directing that court to vacate its order of May 4, 1999, denying the City's motion for a summary judgment and to grant that motion. The sole issue presented by this petition is whether the City is entitled to immunity under § 6-5-338(b), Ala.Code 1975. Because we conclude that it is, we grant the petition.
At 2:20 a.m. on November 1, 1997, Margaret Denise Parker lost control of her vehicle on a residential street in Gadsden. Parker drove through the yard of Shirley McDonough, striking a chain-link fence and dragging it across the street into the yard of James Steward. Parker's vehicle finally came to rest in Steward's yard, but only after striking a second fence. Parker exited the vehicle and began walking toward her house, located a short distance from the accident scene. McDonough's son Gary informed Parker that he was telephoning the police on his cellular phone and then he began following her on foot.
Darrell Arnold was the first police officer to arrive on the scene. McDonough and Steward gave their accounts of what had happened and told Officer Arnold that a witness was following the driver of the vehicle. Fearing the potential for danger because "he had a witness chasing a drunk," and knowing that a second unit was en route, Officer Arnold left the scene in pursuit of the driver and the witness. As Officer Arnold was about to leave, Ms. McDonough informed him that a fence was stretched across the road; Officer Arnold testified that he told McDonough "[D]on't go near it," and that he explained that another patrol unit was on its way to the scene. Steward testified that he asked Officer Arnold to leave his vehicle at the scene with the lights on, to protect the site. Officer Arnold later stated by deposition that he did not recall any such requests having been made.
Arnold left the scene; he located Parker while she was attempting to enter her residence. Parker was arrested and was charged with DUI and resisting arrest. Shortly after Officer Arnold had left the scene, Kandralyn Johnson drove down Winona Avenue and struck the fence that was stretched across the road; as a result of Johnson's striking the fence, McDonough became entangled in the fence and sustained injuries to her right foot and ankle. She sued the City and several other defendants. McDonough alleged in her complaint that Officer Arnold had negligently left the scene of an accident without properly securing the site and that his negligence was the proximate cause of her injuries. The City moved for a summary judgment, arguing that it was entitled to immunity and therefore could not be held liable on McDonough's claims. The trial court denied the motion for summary judgment. This petition followed.
It is well settled that the denial of a motion for summary judgment based on a claim of immunity is reviewable by petition for writ of mandamus:

*938 "The writ of mandamus is an extraordinary remedy and one petitioning for it must show `(1) a clear legal right in the petitioner to the order sought; (2) an imperative duty upon the respondent to perform, accompanied by a refusal to do so; (3) the lack of another adequate remedy; and (4) properly invoked jurisdiction of the court.' Ex parte Alfab, Inc., 586 So.2d 889, 891 (Ala.1991). See Ex parte Davis, 721 So.2d 685, 689 (Ala. 1998), where this Court stated that `[a] petition for a writ of mandamus is the proper means for achieving appellate review of a trial court's denial of absolute and discretionary-function immunity.'"
Ex parte Kelley, 739 So.2d 1095, 1096 (Ala. 1999).
The City argues that § 6-5-338(a), Ala.Code 1975, grants Officer Arnold immunity from tort liability arising out of his conduct in performance of any discretionary function within the line and scope of his official duties, and that § 6-5-338(b) extends that immunity to the City.
Section 6-5-338 provides, in pertinent part:
"(a) Every peace officer, ... whether appointed or employed as such peace officer by the state or a county or municipality thereof, ... shall have immunity from tort liability arising out of his or her conduct in performance of any discretionary function within the line and scope of his or her law enforcement duties.
"(b) This section is intended to extend immunity only to peace officers and governmental units or agencies authorized to appoint peace officers."
In Couch v. City of Sheffield, 708 So.2d 144, 153 (Ala.1998), this Court stated that § 6-5-338 extended discretionary-function immunity to a municipal police officer "unless the officer's conduct is so egregious as to amount to willful or malicious conduct or conduct engaged in in bad faith."
The City argues that in leaving the accident scene Officer Arnold was performing a discretionary act and that he is, therefore, immune from liability. "Qualified immunity shields [an] employee from liability if the employee is engaged in a discretionary act, instead of a ministerial one, when the alleged tortious conduct occurs." Ex parte Alabama Dep't of Forensic Sciences, 709 So.2d 455, 458 (Ala.1997). McDonough argues that Officer Arnold's failure to secure the accident scene in accordance with departmental regulations amounted to negligence in performing a ministerial act; therefore, she argues, Officer Arnold was not protected by the doctrine of discretionary-function immunity. Thus, we must first determine whether Officer Arnold was engaged in performing a discretionary function or a ministerial function.
"Discretionary acts have been defined as those acts as to which there is no hard and fast rule as to the course of conduct that one must or must not take and those acts requiring exercise in judgment and choice and involving what is just and proper under the circumstances." Wright v. Wynn, 682 So.2d 1, 2 (Ala.1996). However, acts taken willfully, maliciously, or in bad faith will not be considered discretionary. Id.; Couch v. City of Sheffield, 708 So.2d 144 (Ala.1998). "Ministerial acts," on the other hand, are those acts "done by officers and employees who are required to carry out the orders of others or to administer the law with little choice as to when, where, how, or under what circumstances their acts are to be done." Carroll v. Hammett, 744 So.2d 906, 910 (Ala.1999)(quoting earlier cases).
The Gadsden Police Department's "Policy and Procedure Manual" contains the following provisions:

*939 "61.1.5 UNIFORM TRAFFIC ENFORCEMENT
". . . .
"C. THESE ENFORCEMENT POLICIES DO NOT SUPPLANT OFFICER JUDGMENT, FOR IT IS IMPOSSIBLE TO FORESEE EVERY CONCEIVABLE SITUATION INVOLVING TRAFFIC VIOLATIONS. IN UNUSUAL CIRCUMSTANCES, THE OFFICER MUST DECIDE WHAT ENFORCEMENT ACTION IS PROPER BASED ON A COMBINATION OF TRAINING, EXPERIENCE AND COMMON SENSE.

". . . .
"61.2.3 FIRST OFFICER ON THE SCENE
"A. IMMEDIATELY UPON ARRIVAL, THE FIRST OFFICER AT THE SCENE WILL CHECK FOR INJURIES, FIRE HAZARDS, HAZARDOUS MATERIALS,[1] AND/OR HOT WIRES DOWN, AND WILL SUMMON APPROPRIATE FIRE/MEDICAL/UTILITY AND BACKUP FOR ASSISTANCE. THE OFFICER WILL PROVIDE EMERGENCY MEDICAL AID AND FIRE SUPPRESSION SERVICES UNTIL FIRE/MEDICAL PERSONNEL ARRIVE. THE OFFICER WILL ISOLATE THE HAZARD AREA, EVACUATE NON-ESSENTIAL PERSONNEL AND IDENTIFY THE VEHICLE AND CONTAINER PLACARDS.
"B. THE OFFICER WILL PARK THE PATROL VEHICLE IN SUCH A MANNER AS TO PROTECT THE SCENE, PRESERVE EVIDENCE AND PROTECT THE PUBLIC, ESTABLISH A SAFE TRAFFIC PATTERN AROUND THE SCENE, LOCATE WITNESSES AND RECORD ACCIDENT INFORMATION. OVERHEAD EMERGENCY LIGHTS WILL BE ACTIVATED WHILE THE ROADWAY IS BLOCKED AND A DANGER EXISTS.
". . . .
"61.4.2 HAZARDOUS ROADWAY CONDITIONS
". . . .
"C. THE FOLLOWING PROCEDURES WILL BE FOLLOWED IN IDENTIFYING, REPORTING AND CORRECTING HAZARDOUS ROADWAY, ROADSIDE, OR ENVIRONMENTAL CONDITIONS:
"1. WHEN A HAZARD IS IDENTIFIED AND IN THE OFFICER'S OPINION SUCH HAZARD REQUIRES IMMEDIATE CORRECTION,... HE WILL IMMEDIATELY INFORM COMMUNICATIONS OF THE SITUATION AND IDENTIFY THE ASSISTANCE OR SPECIAL EQUIPMENT REQUIRED. THE OFFICER WILL PROTECT THE SCENE AND BYSTANDERS AND DIRECT TRAFFIC OR TAKE ANY OTHER ACTION DEEMED NECESSARY TO CORRECT AND/OR PROTECT THE SITUATION UNTIL ASSISTANCE ARRIVES.
"2. WHEN A HAZARD IS DETECTED THAT REPRESENTS A POTENTIAL COLLISION SITUATION, BUT THE THREAT OF SUCH IS NOT IMMINENT, THE OFFICER WILL PASS THIS INFORMATION *940 ON TO COMMUNICATIONS FOR PROPER IDENTIFICATION. IF THE OFFICER CAN CORRECT THE SITUATION, THEY WILL TAKE APPROPRIATE ACTION."
(Capitalization original; other emphasis added.)
Officer Arnold was faced with a situation for which there was no hard and fast set of rules. He could have pursued a witness who was chasing a fleeing DUI suspect, or he could have remained at the scene and protected the site until the next patrol unit arrived. In response to questions about why he did not stay at the scene of the accident until the second police car arrived, Officer Arnold testified, "I felt like the danger to an innocent bystander or witness was more immediate than what I had at the traffic-accident scene at the time." He also stated that he felt the chances that a motor vehicle would come down the road and hit the fence around 2:30 a.m. "were very slim."
Clearly, Officer Arnold's duties as a law-enforcement officer required him to make a difficult split-second decision under unusual circumstances. Because the officer's decision to pursue a suspect being followed by a witness, instead of securing a well-lit accident scene with no injuries, required "an exercise in judgment and choice and [involved] what [was] just and proper under the circumstances," Wright, supra, we conclude that in making that decision Officer Arnold was performing a discretionary act and that § 6-5-338(a), Ala.Code 1975, gave him immunity from liability.[2] The plain language of § 6-5-338(b), Ala.Code 1975, extends that discretionary-function immunity to the City. We therefore grant the petition for the writ of mandamus and direct the Etowah Circuit Court to enter a summary judgment in favor of the City.
WRIT GRANTED.
HOOPER, C.J., and HOUSTON, SEE, and ENGLAND, JJ., concur.
NOTES
[1]  The policy manual defines a "hazardous material" as "any element, compound, or combinations thereof, which is flammable, corrosive, explosive, toxic, radioactive and oxidizer, or is highly reactive and which, because of handling, storing, processing and packaging, may have detrimental effects upon emergency personnel, the public, equipment and/or the environment."
[2]  This holding is consistent with our recent decision in Ex parte Cranman, [Ms. 1971903, June 16, 2000] ___ So.2d ___ (Ala.2000), in which we restated the rule governing State-agent immunity. See Cranman, Part IV, ___ So.2d at ___.
