sentences:  He was defeated in battle and retreated to the fortress of Shusha.After a prolonged siege, Agha Mohammad Khan Qajar failed to take the fortress and left the region.In a verbal truce, Ibrahim Khan acknowledged Qajar supremacy and was permitted to continue to rule as Khan of Karabakh.