Originally Posted by
adrinavarro
I second all the comments saying you should use Cercanías (commuter train network).
It was a good advice indeed, thanks everybody. Except that there was a minor issue with the payment. The terminals don't accept credit cards without pin. I guess most people at Europe always have a pin enabled on the credit cards, but AFAIK this is not nearly as common on other places. I had to pay with a debit card.