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.

Sources told ESPN’s Jeff Passan earlier Tuesday that 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.”

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 and The Associated Press was included in this report.