Witnessing the emergence of a carbon star