Jeep Cherokee rough idle

My 2000 Cherokee cranks and runs fine, but after warm-up if I turn it off for about 5 minutes it idles very roughly for about 30-60 seconds. It cranks and runs fine if it sits for less than about 5 minutes or more than about 10 minutes.