HAMBANTOTA, Sri Lanka—By his last days in power, Gotabaya Rajapaksa had been sequestered in his presidential palace for weeks, say those close to him. Cloistered with a small coterie of military advisers on July 9, the president was escorted to a nearby naval base and put on a warship for his protection, barely leaving his cabin for two days as tens of thousands of protesters occupied his residence clamoring for his resignation.
Interviews with ruling party politicians, presidential advisers and government and military officials reveal a picture of an increasingly isolated Mr. Rajapaksa, distrustful of his own military commanders and fearful of his safety in the final throes of his presidency. A former soldier, Mr. Rajapaksa governed in a way that deepened family rivalries and led to decisions that ultimately had catastrophic consequences for Sri Lanka’s economy, former cabinet members and aides say.

