delivered the opinion of the court:
In a bench trial in the circuit court of Cook County defendant, Charlie Francis, was found guilty of unlawful use of weapons (Ill. Rev. Stat. 1975, ch. 38, par. 24—1(a)(10)). He was sentenced to a one-year conditional discharge (Ill. Rev. Stat. 1975, ch. 38, par. 1005—6—1 et seq.) with two days in custody and fined an amount equal to his bail bond deposit. The appellate court reversed (52 Ill. App. 3d 978), and we allowed the People’s petition for leave to appeal.
The Criminal Code of 1961 in pertinent part provided:
“(a) A person commits the offense of unlawful use of weapons when he knowingly:
* * *
(10) Carries or possesses in a vehicle or on or about his person within the corporate limits of a city, village or incorporated town, except when on his land or in his own abode or fixed place of business, any loaded pistol, revolver or other firearm.” Ill. Rev. Stat. 1975, ch. 38, par. 24 — l(a)(10).
“(a) Subsections 24 — 1(a)(3), 24 — 1(a)(4) and 24 — l(a)(10) do not apply to or affect any of the following:
(4) *** security guards while actually engaged in the performance of the duties of their employment or commuting between their homes and places of employment, provided that such commuting is accomplished within one hour from departure from home or place.of employment ***.” Ill. Rev. Stat. 1975, ch. 38, par. 24-2(a)(4).
“(g) An information or indictment based upon a violation of any Subsection of this Article need not negative any exemptions contained in this Article. The defendant shall have the burden of proving such an exemption.” Ill. Rev. Stat. 1975, ch. 38, par. 24 — 2(g).
The parties stipulated that on February 19, 1976, defendant was arrested by officers of the Chicago Police Department in the city of Chicago at a place other than his home, and that he was then in possession of a fully loaded .38-caliber revolver.
Defendant testified that he was employed as a security agent by the W. L. Lillard Bureau of Investigation. On the day of his arrest he was assigned to service commencing at 9 a.m. at an A & P store on Drexel Avenue as a replacement for a newly hired agent who had not shown for work. Defendant testified that although the new agent arrived at 10:30 a.m., in keeping with normal agency procedure, he remained on duty to supervise the new employee’s work.
Defendant stated that he was first approached by the arresting officers during his lunch break at about 12:30 p.m. while sitting in his car, which was parked in a no-parking zone. Since he did not have his driver’s license with him he showed the officers identification in the form of a State firearms card, an Illinois State registration and identification card, and a W. L. Iillard Bureau of Investigation card. These cards were admitted into evidence. Defendant was issued a traffic citation for failing to have a driver’s license in his possession and sent on his way.
Defendant testified further that he returned to the A & P store for about 10 minutes and then “went off duty”; and that about 5 minutes later as he was driving to a nearby store to purchase some cigarettes, he was again detained by the same officers that had issued him the citation earlier in the day. At this time he was arrested on the unlawful use of weapons charge.
Both of the arresting officers testified. Officer O’Con-nor’s testimony, for the most part, corroborated defendant’s version of the arrest, but he stated that defendant had not told the officers that he had just gone off duty, and that defendant had said that he had gone off duty at 10:30. This latter statement, allegedly made by defendant, is not reflected in the arrest report submitted by the officers.
In reversing, the appellate court held “that defendant in the instant case presented a quantum of evidence sufficient to bring himself within the security guard exemption” (52 Ill. App. 3d 978, 982) and that the People “must prove beyond a reasonable doubt that defendant was not covered by the exemption. (People v. Williams (1975), 28 Ill. App. 3d 67, 71, 328 N.E.2d 192, 195.) The State has failed to sustain its burden.” 52 Ill. App. 3d 978, 983.
Citing People v. Smith (1978), 71 Ill. 2d 95, the People contend that the evidence proved the violation of section 24—1(a)(10) of the Criminal Code and that, as required by section 24—2(g), defendant failed to meet the burden of proving an exemption. Defendant concedes that in view of People, v. Smith, “he failed to prove that he was exempt” from the unlawful use of weapons charge, but argues that Smith reinterpreted the law in regard to a defendant’s burden in proving the exemption and he should, therefore, be granted a new trial.
Although the precise question presented was considered by this court for the first time in People v. Smith, the appellate court has consistently held that the defendant’s burden under section 24—2 required only the production of sufficient evidence to place the question of exemption in issue. (See People v. Rinehart (1967), 81 Ill. App. 2d 125; People v. Johnson (1975), 27 Ill. App. 3d 541; People v. Williams (1975), 28 Ill. App. 3d 67; People v. Smith (1977), 45 Ill. App. 3d 66.) The rule as applied by the appellate court is well stated in People v. Rinehart (1967), 81 Ill. App. 2d 125, and People v. Williams (1975), 28 Ill. App. 3d 67, in which the court said:
“The State argues that the burden of establishing an affirmative defense is on the defendant. This clearly negates a large body of case law and directly contravenes the provisions of chapter 38, section 3 — 2 which states:
‘(a) “Affirmative defense” means that unless the State’s evidence raises the issue involving the alleged defense, the defendant, to raise the issue, must present some evidence thereon.
‘(b) If the issue involved in an affirmative defense of proving the defendant guilty is raised then the State must sustain the burden of proving the defendant guilty beyond a reasonable doubt as to that issue together with all the other elements of the offense.’ ” People v. Rinehart (1967), 81 Ill. App. 2d 125, 128.
“It is a firmly settled proposition of law that the burden of proof never shifts to the defendant no matter what his defense may be. (People v. Durand, 307 Ill. 611.) We view section 24—2(f) [now section 24—2(g)] as placing the burden on defendant to produce a quantum of evidence sufficient to place the question of exemption in issue. Clearly, an exemption is an affirmative defense as defined by the Criminal Code (Ill. Rev. Stat. 1971, ch. 38, par. 3—2), and as we recognized in Rinehart, once an affirmative defense is raised the burden is on the State to prove defendant guilty beyond a reasonable doubt as to that issue. We reject the State’s request to modify our holding in Rinehart.” People v. Williams (1975), 28 Ill. App. 3d 67, 70-71.
In People v. Smith (1978), 71 Ill. 2d 95, the defendant was convicted of unlawful use of weapons in violation of the same statute involved here (Ill. Rev. Stat. 1973, ch. 38, par. 24—1(a)(10)). On appeal he assigned as error the giving of a jury instruction (Illinois Pattern Jury Instructions, Criminal, No. 18.02 (1968)), which in pertinent part read:
“The defendant has the burden of proving by a preponderance of the evidence that at the time of the crime charged he did not have immediate access to such weapon.” 71 Ill. 2d 95, 103.
In holding that the giving of the instruction was not error, the court observed: “It cannot be stressed too much that under this statute each element of the crime itself must be proved by the State beyond a reasonable doubt, and that this obligation of the State remains throughout the proceedings.” (71 Ill. 2d 95, 105.) Recognizing that there are 10 separately enumerated exempt categories applicable to those charged with a violation of section 24—1(a)(10), the court held: “For the State to be saddled with negating each defendant’s place in each of the 10 exempt categories would place impossible burdens upon effective prosecution of this type of case. The legislature has avoided this problem by requiring the prosecution to prove each and every element of the offense beyond a reasonable doubt and by requiring the defendant to prove his entitlement to the exemption.” (71 Ill. 2d 95, 105.) The court expressly rejected the contention that the exemptions provided in section 24—2 were affirmative defenses and held that “it was proper to instruct the jury that the burden of proving, by a preponderance of the evidence, that the defendant came within an exemption to the statute was upon him.” 71 Ill. 2d 95, 109.
Although defendant has conceded that under People v. Smith he failed to meet his burden of proof, our holding in Smith was a significant departure from the prior decisions of the appellate court. When a case is tried under an incorrect theory of law the appropriate action is to reverse the judgment and remand for a new trial. (Sparling v. Peabody Coal Co. (1974), 59 Ill. 2d 491, 496.) Defendant’s testimony that he did not go off duty until after his lunch break and that the arrest occurred approximately five minutes after he left work was sufficient to raise an affirmative defense and on this record we hold that he is entitled to a new trial and the opportunity to meet the burden of proof requisite under People v. Smith. For the reasons stated the judgment of the appellate court is modified to reverse the judgment of the circuit court and remand the cause for further proceedings consistent with this opinion and as so modified is affirmed.
Affirmed as modified; cause remanded.