Padres sign Clayton Richard to two-year contract extension

San Diego Padres starter Clayton Richard throws a pitch to the Los Angeles Dodgers during the first inning of a baseball game, Tuesday, April 4, 2017, in Los Angeles. (Ryan Kang/AP)

SAN DIEGO — The rebuilding San Diego Padres and left-hander Clayton Richard have agreed to a $6 million, two-year contract that runs through 2019.

The 34-year-old Richard is the oldest player on the team, which doesn’t envision being competitive until 2019 or 2020. He is 7-14 with a 4.82 ERA and has thrown 185 innings this season.

Richard could have become a free agent after the World Series. He had a $1.75 million base salary this year and has earned $750,000 in bonuses for making at least 25 starts.

General manager A.J. Preller said Wednesday that Richard wanted to remain with the Padres, and his veteran presence in a clubhouse full of young players is valuable.

Preller said Richard will be in the rotation to start next season, but he understands it will be competitive from there on out and he could be used in other roles.