A sudden reversal, internal pressure and local politics combined to trigger a dramatic exit that caught Government off guard