He had 2 cities left, and conquered both, ransacked one *since i won't have enough war score to take both) built an outpost in the same location, then forced surrendered him to give his last city.

AI was not defeated, now has no cities and he even asked me for a non aggression pact after a few turn to which I accepted (felt sorry since he was homeless).