COLOMBO, Sri Lanka — The president was cornered, his back to the sea.
Inside the dimly lit colonial mansion he had found lonely, Gotabaya Rajapaksa watched from a hastily arranged operations room as the monthslong protests demanding his ouster as Sri Lanka’s leader reached his very doorstep.
A former defense chief accused of widespread abuses during the South Asian nation’s three-decade civil war, Mr. Rajapaksa had taken an uncharacteristically hands-off approach toward the…