
956 N.E.2d 575 (2011)
353 Ill. Dec. 713
ILLINOIS FARMERS INSURANCE COMPANY, Plaintiff-Appellant,
v.
Charles W. KEYSER, Jr., and Cindy R. Stukel, Defendants-Appellees.
No. 3-09-0484.
Appellate Court of Illinois, Third District.
August 22, 2011.
*576 Zacarias R. Chacon, Danny L. Worker (argued), Lewis, Brisbois, Bisgaard & Smith, LLP, Chicago, for Illinois Farmers Insurance Company.
Thomas P. Naughton, Law Office of Thomas P. Naughton, Joliet, for Charles W. Keyser.
Zachary B. Pollack (argued), Sabuco, Beck, Hansen & Schrock, P.C., Joliet, for Cynthia R. Stukel.

OPINION
Justice LYTTON delivered the judgment of the court, with opinion.
¶ 1 Plaintiff Illinois Farmers Insurance Company (Illinois Farmers) filed an action against insured Cindy Stukel seeking a declaration that it was not obligated to defend Stukel in a malicious prosecution lawsuit filed against her by Charles Keyser, Jr. The trial court ruled that the insurance company was required to provide a defense and granted defendants' motion for summary judgment. We affirm.
¶ 2 In May of 2007, Cindy Stukel filed criminal trespass charges against Charles Keyser, Jr. In pursing the charges, Stukel allegedly advised Joliet police officers that Keyser entered her property after receiving verbal notice from her that such entry was forbidden. Keyser was arrested, but the criminal proceedings against him were later dismissed. Keyser then filed a civil complaint for malicious prosecution against Stukel, in which he alleged that Stukel's verbal and written statements to police were false and that Stukel knew they were false when she made them.
¶ 3 During this time, Stukel was insured under a homeowners policy issued by Illinois Farmers. That policy obligated Illinois Farmers to defend and indemnify Stukel against damages caused by "bodily injury, property damage or personal injury resulting from an occurrence" to which coverage applies. The policy definition of "personal injury" included injury arising from "malicious prosecution." The policy defined an "occurrence" as "an accident" resulting in jury. The policy also excluded coverage of bodily injury or personal injury intentionally caused by the insured.
¶ 4 Illinois Farmers filed a declaratory judgment action, seeking a judgment declaring that Stukel's policy did not afford *577 her coverage in the underlying lawsuit because her acts were intentional. It claimed that such intentional acts were excluded under the policy and moved for summary judgment. Stukel and Keyser filed a cross-motion for summary judgment, arguing that the underlying complaint alleged a civil tort of malicious prosecution that was specifically covered by the insurance policy.
¶ 5 The trial court ruled that the policy's inconsistent provisions created an ambiguity that should be construed in favor of the insured and granted defendants' motion.
¶ 6 Summary judgment is proper when the pleadings, affidavits, depositions and admissions of record, construed strictly against the moving party, show that there is no genuine issue as to any material fact and that the moving party is entitled to judgment as a matter of law. Morris v. Margulis, 197 Ill.2d 28, 35, 257 Ill. Dec. 656, 754 N.E.2d 314 (2001). While this relief has been called a "drastic measure," it is an appropriate tool to employ in determining questions of law such as the rights and obligations under an insurance policy. See Outboard Marine Corp. v. Liberty Mutual Insurance Co., 154 Ill.2d 90, 180 Ill.Dec. 691, 607 N.E.2d 1204 (1992); Bohner v. Ace American Insurance Co., 359 Ill.App.3d 621, 296 Ill.Dec. 78, 834 N.E.2d 635 (2005). We conduct a de novo review of the trial court's order granting summary judgment in favor of the defendants. Outboard Marine Corp., 154 Ill.2d at 102, 180 Ill.Dec. 691, 607 N.E.2d 1204.

¶ 7 I
¶ 8 Illinois Farmers claims that it owes no duty to defend or indemnify Stukel in the underlying complaint. It argues that the policy defines an "occurrence" as an "accident" and excludes coverage of intentional conduct; thus, an intentional tort such as malicious prosecution is not covered.
¶ 9 The construction of insurance policy provisions is a question of law. Outboard Marine Corp., 154 Ill.2d at 108, 180 Ill.Dec. 691, 607 N.E.2d 1204. In construing a policy, our primary function is to ascertain and enforce the parties' intent as expressed in the written agreement. Allstate Insurance Co. v. Greer, 396 Ill. App.3d 1037, 336 Ill.Dec. 937, 921 N.E.2d 793 (2009). To ascertain the meaning of a policy, the court must construe it as a whole, taking into account the risk undertaken, the subject matter that is insured and the purposes of the entire contract. Outboard Marine Corp., 154 Ill.2d at 108, 180 Ill.Dec. 691, 607 N.E.2d 1204. A court must afford the policy language its plain and ordinary meaning if the words are unambiguous. However, if the words are susceptible to more than one interpretation, they are ambiguous and must be construed in favor of the insured and against the insurer who drafted the policy. Id. at 108-09, 180 Ill.Dec. 691, 607 N.E.2d 1204.
¶ 10 To determine whether an insurer has a duty to defend its insured, we must compare the allegations of the underlying complaint to the coverage provisions of the insurance policy. Crum & Forster Managers Corp. v. Resolution Trust Corp., 156 Ill.2d 384, 189 Ill.Dec. 756, 620 N.E.2d 1073 (1993). If the underlying complaint alleges facts within or potentially within the policy's coverage provisions, the insurer is obligated to defend even if the allegations are meritless. Crum & Forster Managers Corp., 156 Ill.2d 384, 189 Ill. Dec. 756, 620 N.E.2d 1073.
¶ 11 Here, a comparison of the allegations in the underlying complaint to the terms of the insurance policy demonstrates that Illinois Farmers is obligated to defend Stukel. In the underlying complaint, the *578 cause of action is entitled "Complaint at Law; Malicious Prosecution," and the complaint alleges facts and seeks damages for the common law tort of malicious prosecution. Thus, Keyser's complaint alleges injury arising from malicious prosecution.
¶ 12 The terms of the Illinois Farmers policy cover "personal injury resulting from an occurrence to which this coverage applies." The policy defines "personal injury" as:
"any injury arising from:
(1) false arrest, imprisonment, malicious prosecution and detention."
An "occurrence" is defined in the policy as "an accident including exposure to conditions which results during the policy period in bodily injury or property damage." The policy also contains an exclusionary provision, which states "[w]e do not cover bodily injury, property damage, or personal injury * * * caused intentionally by or at the direction of an insured."
¶ 13 The policy covers personal injury from both accidental conduct and certain enumerated intentional acts, including malicious prosecution. See Johnson v. Target Stores, Inc., 341 Ill.App.3d 56, 274 Ill.Dec. 795, 791 N.E.2d 1206 (2003) ("malice" defined as "the intent" to commit a wrongful act). Where Illinois Farmers expressly undertook coverage of malicious prosecution in the policy, it assumed a duty to defend Stukel in the underlying case.
¶ 14 Were we to accept Illinois Farmers' position, coverage for certain named intentional torts would be included under the definition of "personal injury" and then removed under the meaning of "occurrence." This would render the provision defining personal injury superfluous and would create an ambiguity where none exists. As the trial court aptly noted:
"If Farmers' argument were taken to its logical conclusion, then the policy would not make any sense, and would be providing coverage in one sentence and then taking it away."
¶ 15 We decline to adopt an interpretation that would lead to illusory coverage. See State Farm Fire & Casualty Co. v. Trousdale, 285 Ill.App.3d 566, 220 Ill.Dec. 711, 673 N.E.2d 1132 (1996).[1]

¶ 16 II
¶ 17 Illinois Farmers also argues that, if a defense of the underlying complaint is covered under the policy, it would violate public policy because it insures against intentional misconduct.
¶ 18 Generally, a contract of insurance that indemnifies a person for damages resulting from his own intentional misconduct is void as against public policy, and courts will not enforce it. Dixon Distributing Co. v. Hanover Insurance Co., 161 Ill.2d 433, 204 Ill.Dec. 171, 641 N.E.2d 395 (1994). However, it is also a fundamental policy in Illinois that when an insured pays a premium and an insurance company accepts it and promises coverage based on the premium paid, the insurer should be required to fulfill its obligation. University of Illinois v. Continental Casualty Co., 234 Ill.App.3d 340, 175 Ill.Dec. 324, 599 N.E.2d 1338 (1992). Whether a particular contract of insurance violates public policy depends on the nature of the risk against which insurance is sought. Dixon Distributing Co., 161 Ill.2d at 447, 204 Ill.Dec. 171, 641 N.E.2d 395.
¶ 19 Applying these public policy principles, Illinois courts have approved personal *579 injury coverage of certain intentional torts such as retaliatory discharge and defamation. See Dixon Distributing Co., 161 Ill.2d 433, 204 Ill.Dec. 171, 641 N.E.2d 395 (personal injury liability included coverage of retaliatory discharge); Cincinnati Insurance Co. v. American Hardware Manufacturers Ass'n, 387 Ill.App.3d 85, 325 Ill.Dec. 483, 898 N.E.2d 216 (2008) (coverage provision specifically listed defamation and libel); University of Illinois, 234 Ill. App.3d 340, 175 Ill.Dec. 324, 599 N.E.2d 1338 (intentional misconduct covered racial and sexual discrimination). On the other hand, they have excluded coverage of intentional torts that are also serious crimes. See Lincoln Logan Mutual Insurance Co. v. Fornshell, 309 Ill.App.3d 479, 242 Ill. Dec. 750, 722 N.E.2d 239 (1999) (murder); West American Insurance Co. v. Vago, 197 Ill.App.3d 131, 143 Ill.Dec. 195, 553 N.E.2d 1181 (1990) (sexual assault; battery).
¶ 20 The distinction is apparent. For example, in Lincoln Logan Mutual Insurance, the insurer brought a declaratory judgment against a convicted murderer and the victim's parents seeking a declaration that it had no duty to defend against a wrongful death claim under the personal liability provision of its policy. The court decided that the policy's provision must be read in conjunction with the insured's reasonable expectations and the coverage intended by the insurance policy, neither of which intended coverage for the criminal act of murder. See Lincoln Logan Mutual Insurance, 309 Ill.App.3d at 483-85, 242 Ill.Dec. 750, 722 N.E.2d 239.
¶ 21 Here, Stukel contracted to insure against the risk of loss resulting from the intentional civil tort of malicious prosecution, and Illinois Farmers promised coverage when it accepted her premium payments. While generally excluding coverage of intentional conduct, the policy explicitly provided coverage for damages caused by malicious prosecution, and the insured could reasonably anticipate that the policy protections would apply. Public policy requires Illinois Farmers to fulfill its contractual obligation to defend and indemnify.
¶ 22 Moreover, public policy favors affording compensation to victims. Lincoln Logan Mutual Insurance, 309 Ill. App.3d at 483, 242 Ill.Dec. 750, 722 N.E.2d 239. Thus, there is nothing inherently unreasonable or inconsistent with Illinois public policy in allowing an individual to insure himself against damages caused by certain intentional acts, except to the extent that the insured wrongdoer may not be the person who recovers the policy proceeds. See Dixon Distributing Co., 161 Ill.2d at 446-47, 204 Ill.Dec. 171, 641 N.E.2d 395. "Indemnity against intentional misconduct may be tolerated where it provides benefits to the victim, but not where it compensates the wrongdoer." Lincoln Logan Mutual Insurance, 309 Ill. App.3d at 483, 242 Ill.Dec. 750, 722 N.E.2d 239. In this case, indemnity against Stukel's intentional conduct may provide benefits to Keyser but will not compensate Stukel for her wrongdoing. The Illinois Farmers insurance policy provides coverage against a claim of malicious prosecution and does not violate Illinois public policy.

¶ 23 III
¶ 24 The judgment of the circuit court of Will County is affirmed.
¶ 25 Affirmed.
Justices McDADE and O'BRIEN concurred in the judgment and opinion.
NOTES
[1]  At most, Illinois Farmers' interpretation of the policy creates an ambiguity that we must interpret in Stukel's favor. See Cincinnati Insurance Co. v. American Hardware Manufacturers Ass'n, 387 Ill.App.3d 85, 325 Ill.Dec. 483, 898 N.E.2d 216 (2008).
