Formation and collapse of an internal transport barrier