delivered the opinion of the court:
Defendant Earl Smith appeals his conviction for armed violence. For the following reasons, we reverse the conviction and remand for further proceedings.
At trial in the circuit court of Kankakee County, police officers testified that they executed a search warrant at defendant’s apartment on June 22, 1994. As police approached the apartment building, they saw defendant drop a handgun out of the apartment window. The gun slid down the roof of the building’s porch and onto the ground, where police recovered it. The gun was not loaded. In the living room of the apartment, police found 2.5 grams of cocaine behind a couch and 2.1 grams of cannabis on a coffee table. Defendant was found in the bedroom near a window, the screen of which had been pushed outward. No other persons were found in the apartment, and no ammunition was discovered.
At the close of the evidence, the court found defendant guilty of armed violence, unlawful possession of a controlled substance, unlawful possession of a weapon by a felon, and unlawful possession of cannabis. The court found defendant not guilty of an additional charge of unlawful possession of a controlled substance with intent to deliver. The court vacated the conviction for unlawful possession of a controlled substance because it served as the underlying felony for armed violence. See People v. Donaldson, 91 Ill. 2d 164, 170 (1982) (holding that convictions for both armed violence and an underlying felony cannot stand where a single physical act is the basis for both charges). The court sentenced defendant to concurrent prison terms of nine years for armed violence, two years for unlawful possession of a weapon by a felon, and time served for unlawful possession of cannabis.
The appellate court affirmed, with one justice dissenting. No. 3 — 96—0335 (unpublished order under Supreme Court Rule 23). The majority held that defendant could be found guilty of armed violence despite the fact that he dropped the gun out the window before police entered the apartment. The majority also held that the evidence at trial was sufficient to convict defendant of unlawful possession of a controlled substance, the predicate felony for defendant’s armed violence conviction. The dissent argued that defendant was not guilty of armed violence because he disposed of the unloaded gun as soon as he saw the police. This court allowed defendant’s petition for leave to appeal.
Defendant contends that the trial and appellate courts erred in finding that he committed the offense of armed violence. Because the facts are not in dispute, defendant’s guilt is a question of law, which we review de novo. A person commits armed violence when, while armed with a dangerous weapon, he commits any felony defined by Illinois law. 720 ILCS 5/33A — 2 (West 1992). A person is considered armed with a dangerous weapon when he or she carries on or about his person or is otherwise armed with a Category I or Category II weapon. 720 ILCS 5/33A — 1(a) (West 1992). A handgun is a Category I weapon. 720 ILCS 5/33A — 1(b) (West 1992).
In construing the meaning of the phrase “otherwise armed” as used in the armed violence statute, this court has emphasized that the statute’s purpose is to deter felons from using dangerous weapons, thereby minimizing the deadly consequences which may result when a felony victim resists. People v. Condon, 148 Ill. 2d 96, 109 (1992). In Condon, we found that this deterrent purpose was not served and so reversed the defendant’s armed violence conviction. As in the instant case, the police in Condon executed a search warrant to seize illegal drugs located in the defendant’s residence. When police entered the residence, Condon was standing in the apartment with no weapon on or about his person. Although numerous guns were found elsewhere in the residence, we held that Condon’s conviction for armed violence could not be sustained because he did not have “ ‘immediate access to’ or ‘timely control over’ a weapon when the police entered.” Condon, 148 Ill. 2d at 110.
Conversely, in People v. Harre, 155 Ill. 2d 392 (1993), we affirmed the armed violence conviction of a defendant who was apprehended by police during a drug raid as he made a move toward his car, which contained two guns. In our opinion in Harre, we noted that at the time police confronted the defendant in Condon, Condon did not have the “intent and capability to maintain control and possession” of the weapons, while Harre clearly did. Harre, 155 Ill. 2d at 399-401.
Applying these principles to the facts of the instant case, we conclude that defendant did not commit the offense of armed violence. Defendant did not have “ ‘immediate access to’ or ‘timely control over’ a weapon when the police entered” (Condon, 148 Ill. 2d at 110), because he dropped the gun out of the window as soon as he became aware that police were approaching. For this same reason, defendant also did not have the “intent and capability to maintain control and possession” of the weapon, as this court has required. Harre, 155 Ill. 2d at 399-401. Permitting an armed violence conviction to stand against a felon such as defendant, who exhibited no propensity to violence and dropped the unloaded gun out of the window as the police approached his apartment to search for drugs, would not serve, but rather would frustrate, the statute’s purpose of deterring criminals from involving themselves and others in potentially deadly situations.
Defendant also contends that the evidence was insufficient to convict him of unlawful possession of a controlled substance because the State did not prove that he was aware of the drugs found in his living room. This court has held, however, that the mere presence of illegal drugs on premises which are under the control of the defendant gives rise to an inference of knowledge and possession sufficient to sustain a conviction absent other factors which might create a reasonable doubt as to the defendant’s guilt. People v. Nettles, 23 Ill. 2d 306, 308-09 (1961). We believe that under the circumstances of the instant case, the trier of fact was entitled to rely on this inference in finding that defendant had knowledge and possession of the drugs.
The judgment of the appellate court is affirmed in part and reversed in part. Defendant’s conviction for armed violence is reversed, his conviction for unlawful possession of a controlled substance is reinstated, and the cause is remanded to the circuit court for further proceedings.
Appellate court judgment reversed in part and affirmed in part; circuit court judgment reversed in part and affirmed in part; cause remanded.