The 35-year-old has been struggling with injuries in recent seasons.
“I would’ve liked to have played more these years but, unfortunately, because of the injuries, I haven’t been able to,” said an emotional De la Pena.
“I want to thank everyone for all the support I’ve received. My head would like to continue, but my body has said ‘enough’.”
De la Pena will make his farewell in the match at home to Sevilla on Saturday.
“I hope to go onto the pitch once again, after so much time, and say goodbye from the centre of the field,” he said.
“Saturday’s will be my most difficult game. It will be tough but also nice.
“I’m hoping to enjoy Saturday, to say goodbye on the pitch if the coach puts me on.
“Then we’ll see. I would like to continue in the world of football, because it’s what I’ve always done, but now I want to be with my family.”