The Civ AI cannot resist the temptation of an empty city: here's an example of how to lure units out in Civ4.
The bait is particularly tempting for the AI as it originally owned it.
This is not an ideal trap though: ideally, the unit will need to move into friendly territory before being destroyed (doubling Great General points).