SAN DIEGO (AP)Right-hander Nick Martinez has agreed to a three-year, $26 million contract with the San Diego Padres.

Martinez had turned down a $6.5 million contract with San Diego last week, becoming a free agent. But the Padres made a more substantial offer after he went 4-4 with a 3.47 ERA in his return from Japanese baseball.

”I love the city,” Martinez said Wednesday, according to the San Diego Union-Tribune. ”The fans were incredible. The support, the love. I feel like they have the same desire to win as the team does. Obviously, you talk about the clubhouse, how great the group of guys are, it was really a no-brainer.”

Martinez split time between the rotation and the bullpen last season.

The new deal guarantees him $10 million in 2023, $8 million in ’24 and $8 million in ’25. He can opt out after ’23, and the deal contains performance bonuses. Should he perform well as a starter, the team has $16 million options for both ’24 and ’25.

”The contract speaks for itself,” Martinez said. ”I’m going to have an opportunity to show I can start for an entire year. Through my incentives and what I’m getting paid this year, those team options give me a chance to prove that. I’m also guaranteeing some security for my family.”

AP MLB: https://apnews.com/hub/mlb and https://twitter.com/AP-Sports