DETROIT — Tigers ace Eduardo Rodriguez used his no-trade clause to veto a deal Tuesday and remain with Detroit, general manager Scott Harris said.

Harris confirmed the team had an agreement on a trade with the Los Angeles Dodgers and also confirmed that Rodriguez exercised his no-trade clause before Tuesday’s deadline, although he declined to say if Rodriguez specifically blocked the deal with L.A.

Rodriguez invoked his 10-team no-trade clause — that included the Dodgers — to block a deal that was in place between the two teams.

“We reached an agreement that he was not comfortable with,” Harris said.

The left-handed Rodriguez can opt out of his $77 million, five-year contract after the season and become a free agent, or he can choose to play out the deal that pays him $18 million in 2024, $16 million in 2025 and $15 million in 2026.

“We’re excited to get Eduardo back,” Harris said. “He sent a very strong message that he likes it here.”

The Dodgers landed Lance Lynn last week and were only chasing high-end starting pitching, a list that was basically limited to Rodriguez, Justin Verlander, Mitch Keller and Dylan Cease, the latter two of whom did not move. They expressed shock that Rodriguez passed up on the opportunity to play with them for the next two-plus months.

“We thought it was done,” Dodgers president of baseball operations Andrew Friedman said. “And then we learned that it wasn’t.”

The Dodgers deployed some of their players, some of whom previously teamed with Rodriguez on the Boston Red Sox, in an effort to get Rodriguez to change his mind, but to no avail.

“We thought with having a lot of his ex-teammates and guys he’s played with, our place in the standings, I thought we would be very desirable,” said Friedman, who instead acquired a depth piece in Ryan Yarbrough from the Kansas City Royals in the final minutes of the deadline.

“We never got a chance to talk to Eduardo. But we talked to his agent numerous times. We respect that he had this right and he exercised it. Obviously would’ve loved for him to join what we have going here. But it’s hard for us to argue with family reasons.”

Detroit was unable to deal Rodriguez despite his 6-5 record with a 2.95 ERA this season, and a career record of 75-49, in large part because of his contract.

If he opts out following the season, the team that could have added him ahead of the trade deadline would have him on the mound for a short time.

If the 30-year-old Rodriguez had a significant injury with his new team, it would risk having a banged-up pitcher on the payroll for three seasons and $49 million.

“His performance is a fit for every team in baseball,” Harris said. “However, there were contractual headwinds that influenced his market.”

Rodriguez has bounced back this season after going 5-5 in 17 starts last year, his first in Detroit after cashing in on his strong run with the Boston Red Sox.

In June 2022, the Tigers placed Rodriguez on the restricted list after he informed them that he would not rejoin the team due to personal matters. He returned later in the year and has been one of top pitchers for the rebuilding franchise this season.

Detroit did get a significant deal done before the deadline, sending right-hander Michael Lorenzen to the Philadelphia Phillies for minor league infielder Hao-Yu Lee on Tuesday.

Detroit did finalize one deal with the Dodgers, acquiring minor league infielder Eddys Leonard for cash. Leonard, who was hitting .254 in Double-A, was assigned to Triple-A Toledo.

And after they missed on Rodriguez, the Dodgers made a deadline deal for Royals left-hander Ryan Yarbrough, sending minor league infielders Devin Mann and Derlin Figueroa to Kansas City.

Yarbrough, 31, has pitched well since missing two months after being hit in the face by a line drive. He posted a stellar month of July: In 24⅔ innings, he gave up six runs and struck out 15 batters, walking only two.

Yarbrough is 4-5 with a 4.24 ERA for the season, with 14 appearances (seven starts). He’s been strong as a starter this season, going 4-3 with a 3.08 ERA.

Yarbrough has a career mark of 44-36 with a 4.32 ERA with Tampa Bay (2018-22) and Kansas City.

Mann, 26, was selected in the fifth round of the 2018 draft by Los Angeles. He was slashing .307/.402/.541 with 14 homers and 71 RBIs through 89 games with Triple-A Oklahoma City.

Figueroa, 19, was batting .237 in the rookie-level Arizona Complex League.

Information from Reuters, The Associated Press and ESPN’s Alden Gonzalez was included in this report.