
178 Cal.App.3d 887 (1986)
223 Cal. Rptr. 884
THE PEOPLE, Plaintiff and Respondent,
v.
DAVID GARCIA et al., Defendants and Appellants.
Docket Nos. F004740, F004801.
Court of Appeals of California, Fifth District.
March 13, 1986.
*889 COUNSEL
Carlo Andreani and Gregory Lawrance, under appointments by the Court of Appeal, for Defendants and Appellants.
John K. Van de Kamp, Attorney General, Joel E. Carey and Sandra V. Hughes, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[*]]
OPINION
MARTIN, J.
On February 16, 1984, the Madera County District Attorney filed an information in superior court charging defendants David Garcia and *890 Juan Belmontes with battery upon a custodial officer. (Pen. Code, § 243.1.)[1] The information also alleged defendant Garcia served a prior prison term and defendant Belmontes had served two prior prison terms within the meaning of section 667.5, subdivision (b).
At trial, the lower court denied a motion in limine regarding defendants' contention that Madera Department of Corrections employees are not custodial officers. (§ 831.) Both defendants then waived their rights to a jury trial on the issue of their prior prison terms and admitted those allegations. Thereafter, the trial court denied defendant Garcia's motion for a mistrial. The court also denied defendant Belmontes' motion for acquittal pursuant to section 1118.1. The jury found defendants guilty as charged.
The trial court sentenced defendants Garcia and Belmontes to eight months in prison (one-third of the middle term of two years) to be served consecutively with sentences imposed in their other pending cases. Both defendants filed timely notices of appeal.

FACTS
On January 26, 1984, Richard Stoltz was a correctional officer with the Madera County Department of Corrections. He had the responsibility of transporting defendant Garcia to a court appearance. During the noon hour, he went to cell block 12, the maximum security section of the county jail, which housed both defendants. He called to defendant Garcia and instructed him to prepare for transportation. Garcia left his cell and entered the "sallyport," a secure space with one set of doors with open bars leading into the cell and another door with similar bars leading to an outer area. Officer Stoltz entered the "sallyport," instructed Garcia to bend down on his knees, and placed a set of leg irons on Garcia's feet. Then Stoltz ordered Garcia to stand up and face him. At that point, Stoltz placed a set of body chains around Garcia's chest. As he reached to place a pair of handcuffs on Garcia, Stoltz heard defendant Belmontes yell, "Now's your chance, fire up on him."
Stoltz testified in jail vernacular the term "fire up" means to start punching the intended person. Stoltz glanced up at Garcia to see if he would take Belmontes seriously. Garcia then grabbed Stoltz' shirt, pushed him back, punched him in the right eye, and punched his head six or seven times before he could get out of the way.
Madera Correctional Officer Clifford Hylden was standing outside the block 12 "sallyport" while Stoltz prepared Garcia for transportation. Immediately *891 prior to the incident he recalled hearing loud voices from the inmates and then someone yelling to Garcia, "Go on and fire him up."
Once defendant Garcia began punching Stoltz, Hylden radioed the control center to open the "sallyport" doors and then yelled to his shift supervisor, Sergeant Joe Martinez, for assistance. The two officers entered the "sallyport" and saw Garcia strike Stoltz about the head, shoulders, and back. Hylden and Martinez tackled Garcia to the floor. Stoltz handcuffed Garcia while Hylden and Martinez restrained him. After Garcia was restrained, defendant Belmontes walked up to the "sallyport" area and said, "I didn't mean it, Stoltz. I was just kidding. I didn't know he was going to fire up on you." Stoltz replied, "You may have just been kidding, but he fired up on me anyway, didn't he?" Officer Hylden testified Belmontes had a reputation for being "a wise guy" at times and a leader of other inmates.

Defense
Defendant Garcia testified on his own behalf. On October 26, 1984, he was in cell block 12 when Officer Stoltz ordered him into the "sallyport." He had suffered a bullet wound in his leg and felt pain when Officer Stoltz ordered him on his knees. After Stoltz attached the leg chains, Garcia grimaced because the chains were pinching his Achilles tendon. Stoltz then began to place a belly chain around Garcia's chest. The chain slapped against Garcia's wound, he became angry, and he grabbed Stoltz's shirt.
Garcia admitted he and Stoltz exchanged punches. However, he denied hearing Belmontes say anything to incite his actions. Garcia stopped fighting once the "sallyport" door was opened. Officer Hylden entered and immediately began "Kick punching" Garcia in the midsection of his body. Sergeant Martinez followed Hylden into the "sallyport" and both officers wrestled Garcia to the floor. After Garcia was handcuffed, Stoltz hit him in the head two or three times.
Raymond Chavez also testified on behalf of Garcia. Chavez said he was in the cell with Belmontes when the altercation began. Stoltz and Belmontes had been joking around before Stoltz entered the "sallyport." When Chavez heard Belmontes yell, "Fire up on him," he did not think it was unusual because Belmontes always joked with Stoltz in that manner. Chavez did not see who threw the first punch. However, he noticed Garcia retreated to a corner of the area once the "sallyport" door was opened. After Officers Hylden and Martinez entered, they tackled Garcia to the floor and handcuffed him. Officer Stoltz then began beating Garcia in the head.
On cross-examination, the district attorney impeached Chavez' credibility with evidence of prior felony convictions for escape with force, escape *892 without force, three counts of assault with a deadly weapon on a custodial officer, possession of heroin for sale, and grand theft.

DISCUSSION

I. WERE DEFENDANTS PROPERLY CONVICTED OF VIOLATING SECTION 243.1?
(1a) Defendants contend their convictions should be reversed because Officer Stoltz was not a "custodial officer" within the meaning of sections 243.1 and 831.
Prior to trial, defendants moved in limine, contending Officer Stoltz was not a "custodial officer" within the meaning of section 243.1 since he was not employed by a "law enforcement agency of a city or county" pursuant to section 831. Defendants alleged the Madera County Department of Corrections was subject to the direct supervision of the county board of supervisors and was therefore not a "law enforcement agency of a city or county." The court conducted a hearing outside of the presence of the jury. The district attorney called Lieutenant Robert K. Hensel of the Madera County Department of Corrections to establish the department was a "law enforcement agency of a city or county" within the meaning of section 831. Lieutenant Hensel testified Officer Stoltz was a correctional officer whose duties involved transportation of inmates from the jail to court and medical appointments. Lieutenant Hensel said the county established the department of corrections pursuant to Government Code section 23013 on December 1, 1978. The Madera County Department of Corrections answers to the Madera County Board of Supervisors. According to Hensel, only Madera and Napa Counties have departments of corrections. In all other California counties, the county sheriff administers the jail that houses county inmates.
After argument by counsel, the trial court concluded Correctional Officer Stoltz was a "custodial officer" within the meaning of sections 243.1 and 831 and denied defendants' motion.
Section 243.1 states: "When a battery is committed against the person of a custodial officer as defined in Section 831 of the Penal Code, and the person committing the offense knows or reasonably should know that such victim is a custodial officer engaged in the performance of his duties, and such custodial officer is engaged in the performance of his duties, the offense shall be punished by imprisonment in the state prison."
Section 831, subdivision (a) states: "A custodial officer is a public officer, not a peace officer, employed by a law enforcement agency of a city or *893 county who has the authority and responsibility for maintaining custody of prisoners and performs tasks related to the operation of a local detention facility used for the detention of persons usually pending arraignment or upon court order either for their own safekeeping or for the specific purpose of serving a sentence therein."
Although defendant Belmontes erroneously contends he was charged with violation of section 241.1, he argues: "This extraordinarily precise definition does not, whatever its drafters intended, cover Office[r] Stolz [sic]. In most counties, custodial officers are employed directly by the County Sheriff. They are thus `employed by a law enforcement agency.' However, a[s] Lt. Hensel testified, he and Officer Stolz [sic] were employed by the Department of Corrections which was answerable directly to the Board of Supervisors of Madera County. Custodial officers in Madera County are therefore not under the control of the Sheriff's Department. The Department of Corrections is not a `law enforcement agency.' The duty of its officers is merely that of maintaining custody of prisoners. It did not `ferret out and prosecute crime', as confirmed by Lt. Hensel. Indeed, when a jail break took place in December 1983, the Department called in a law enforcement agency, the Madera City Police Department, to deal with the matter.... [¶] Accordingly, therefore, Officer Stolz [sic] was not a custodial officer within the meaning of Penal Code section 241.1 [sic] and appellant could not be guilty of an offense under that section. His conviction should therefore be reversed."
(2) In the construction of a statute, the intention of the Legislature is to be implemented whenever possible. (3) When a general and particular provision are inconsistent, the latter is paramount to the former. A particular intent will control a general one that is inconsistent with it. (Code Civ. Proc., § 1859.) (4) This court summarized certain well established rules of statutory interpretation in Rushing v. Powell (1976) 61 Cal. App.3d 597, 603-604 [130 Cal. Rptr. 110]:
"Statutes must be given a fair and reasonable interpretation, with due regard to the language used and the purpose sought to be accomplished. (Cedars of Lebanon Hosp. v. County of L.A. (1950) 35 Cal.2d 729, 734-735 ...; People v. Sciortino (1959) 175 Cal. App.2d Supp. 905, 908-909....) (5) Words of a statute must be given such interpretation as will promote rather than defeat the general purpose and policy of the law. (City of L.A. v. Pac. Tel. & Tel. Co. (1958) 164 Cal. App.2d 253, 256-257....) (6) Moreover, legislative intent should be gathered from the whole act rather than from isolated parts or words. (People v. King (1952) 115 *894 Cal. App.2d Supp. 875, 878 ...; People v. Sciortino, supra, 175 Cal. App.2d Supp. 905, 909.) (7) The object sought to be achieved by the statute and the evil sought to be prevented are of prime consideration in its interpretation. (Freedland v. Greco (1955) 45 Cal.2d 462, 467....) (8) Finally, although the courts are not at liberty to impute a particular intention to the Legislature when nothing in the language of the statute implies such intention, where the main purpose of the statute is expressed the courts will construe it so as to effectuate that purpose by reading into it what is necessary or incident to the accomplishment of the object sought. (See Dickey v. Raisin Proration Zone No. 1 (1944) 24 Cal.2d 796, 810-811 ...; Struckman v. Board of Trustees (1940) 38 Cal. App.2d 373, 376....)"
(9) The elements of section 243.1 are: (1) a battery; (2) committed against the person of a custodial officer as defined in section 831; (3) where the person committing the offense knows or reasonably should know such victim is a custodial officer engaged in the performance of his duties; and (4) such custodial officer is engaged in the performance of his duties. (1b) Defendants contend Officer Stoltz was not a custodial officer within the meaning of section 831.
Under section 831, a custodial officer is (1) a public officer, not a peace officer; (2) employed by a law enforcement agency of a city or county; (3) who has the authority and responsibility for maintaining custody of prisoners and performing tasks related to the operation of a local detention facility used for the detention of persons usually pending arraignment or upon court order either for their own safekeeping or the specific purpose of serving a sentence. We address each element in turn.
Section 830 et seq. specify the duties and functions of "peace officers" and specify those persons who have that status. Correctional, parole, and probation officers of the Department of Corrections, the Department of the Youth Authority, and the Youthful Offender Parole Board are deemed "peace officers." Transportation officers and employees having custodial responsibilities in an institution operated by a probation department are also deemed peace officers. (§ 830.5.) However, these code sections do not specify county custodial officers as "peace officers." Section 830 states: "... [N]o person other than those designated in this chapter is a peace officer." Thus, Stoltz does not come within the definition of "peace officer."
Under the California Constitution, "public officer and employee" includes every officer and employee of every county, city, city and county, district, and authority, including any department, division, bureau, board, commission, agency, or instrumentality of any of the foregoing. (Cal. *895 Const., art. XX, § 3.) Therefore, Stoltz, an employee of the Madera County Department of Corrections, was a "public officer."
Second, a custodial officer must be employed by a "law enforcement agency" of a city or county. The Penal Code does not define the term "law enforcement agency" for purposes of sections 243.1 and 831. Defendants argue the Madera County Department of Corrections is not a "law enforcement agency" because it does not "function to ferret out and prosecute crimes except within the jail's jurisdiction where they served warrants and wrote reports on crimes occurring within." To the contrary, defendants' argument goes to the very definition of a custodial officer's duties: "A custodial officer ... may make arrests for misdemeanors and felonies within the local detention facility pursuant to a duly issued warrant...." (§ 831, subd. (f).) (10) When used in a statute, words must be construed in context, keeping in mind the nature and obvious purpose of the statute where they appear. Moreover, the various parts of a statutory enactment must be harmonized by considering the particular clause or section in the context of the statutory framework as a whole. (Moyer v. Workmen's Comp. Appeals Bd. (1973) 10 Cal.3d 222, 230 [110 Cal. Rptr. 144, 514 P.2d 1224].) Section 831, by its own provisions, defines the position of "custodial officer," outlines the powers and duties of persons holding that position, and specifies the training necessary for that position. (1c) Defendants essentially contend a jail employee must be subject to the supervision of a sheriff or police chief to be a "custodial officer." To adopt this view would exalt form over substance. The law enforcement character of the employing agency is not exclusively determined by the title of the public official exercising supervisory powers over the agency employees. The Madera County Department of Corrections was established pursuant to Government Code section 23013, which states in relevant part: "The board of supervisors of any county may, by resolution, establish a department of corrections, to be headed by an officer appointed by the board, which shall have jurisdiction over all county functions, personnel, and facilities, or so many as the board names in its resolution, relating to institutional punishment, care, treatment, and rehabilitation of prisoners, including, but not limited to, the county jail and industrial farms and road camps, their functions and personnel."
Under the foregoing provision a county sheriff's law enforcement responsibilities with respect to a county jail are vested in the officer appointed to supervise the department of corrections. As the First District Court of Appeal has noted: "It cannot be seriously contended that the supervision of prison inmates is any less hazardous than the supervision of the general public by policemen. Detection of criminal activity within the walls of a *896 prison cannot be functionally distinguished from the detection of criminal activity in society. Fellow correctional officers and prison inmates are entitled to the same expectation as the general public with respect to protection against criminal attack." (Kimball v. County of Santa Clara (1972) 24 Cal. App.3d 780, 785 [101 Cal. Rptr. 353] [correctional officer employed by county sheriff's office engaged in "active law enforcement service" within the meaning of disability leave of absence law]; see also 52 Ops.Cal.Atty.Gen. 228 (1969).) In the absence of express statutory authority to the contrary, the county department of corrections established pursuant to Government Code section 23013 is by any reasonable definition a "law enforcement agency" within the meaning of section 831. This is because the Madera County Department of Corrections is vested with the same authority as a county sheriff with respect to the institutional punishment, care, treatment and rehabilitation of prisoners. (§ 4000 et seq.; Gov. Code, § 23013.)
The last element of the definition of "custodial officer" relates to the officer's tasks and responsibilities. In the instant case, Lieutenant Hensel testified Officer Stoltz was a correctional officer for the Madera County Department of Corrections. His basic duty was the transportation of inmates to and from court and medical appointments. Defendant Garcia properly notes "transportation officers" are governed by section 831.6. However, that statute refers to public officers "appointed on a contract basis by a peace officer to transport a prisoner or prisoners." Section 830 provides in relevant part: "... [No] person other than those designated in this chapter is a peace officer." Since the appointed head of a county department of corrections is not specified as a peace officer within the meaning of section 800 et seq., section 831.6 does not apply in the instant case. Custodial officers' duties, as defined by Lieutenant Hensel, included "maintaining custody of prisoners" and "tasks related to the operation of a local detention facility" within the meaning of section 831.
The trial court correctly concluded Officer Stoltz was a "custodial officer" as defined in section 831, subdivision (a). There was no error.

II-III[*]
.... .... .... .... .... .... .
*897 The judgment is affirmed.
Hanson (P.D.), Acting P.J., and Woolpert, J., concurred.
NOTES
[*]   Pursuant to California Rules of Court, rule 976.1, this opinion is certified for publication with the exceptions of parts II and III.
[1]  All statutory references are to the Penal Code unless otherwise indicated.
[*]   See footnote on page 887, ante.
