Oystercard

Hi, does TFL rail accept Oyster card? Or this card is only used for bus and underground?

Thanks