The Orioles dealt veteran starter Charlie Morton to the Detroit Tigers just before the approach of the 6 p.m. trade deadline, a source confirmed.

ESPN first reported the deal.

The Tigers have a commanding lead in the AL Central and feature reigning AL Cy Young winner Tarik Skubal at the top of their starting rotation.

Earlier this season, a trade of this variety would have been hard to envision, given the shaky nature of Morton’s performances. But over the last three months, Morton redefined his time in Baltimore by pitching to a 3.62 ERA since May 10.

That, plus his clubhouse presence and postseason experience, made Morton a coveted arm to stabilize another rotation. Morton, at 41, is a two-time World Series winner. He has the ability to perform in a swing-man role out of the bullpen once October strikes.

Morton’s season turned around while he warmed up in the bullpen at Angel Stadium on May 10 ahead of his relief appearance. The curveball, which had eluded his command for much of the year, suddenly zipped out of his hand just right. He could hear the difference as his finger caught the seam of the baseball to send it spinning toward the plate.

“I can hear my finger when my finger catches the seam,” Morton said. “And then I saw it in the bullpen and I was like, ‘Oh my goodness, that was it.’”

Part of the reason the Orioles are even sellers at this point is because of how poorly they started the season. The rotation was a major factor in that early-season spiral, and Morton has acknowledged the reality himself.

Through five starts, Morton held a 10.89 ERA. His curveball fluttered out of his hand almost unrecognizably. That fills him with regret — better performances from the 41-year-old earlier might have helped paint a different season outlook for Baltimore.

“I’m not really sure when I look back how I’m going to feel about it, other than the fact this group in here is capable of a lot more than this,” Morton said. “And the part that I played in that momentum going in the wrong direction, that’s what troubles me the most. But it wasn’t for a lack of preparation. It wasn’t for a lack of trying. It wasn’t for a lack of caring or for a lack of buying in or anything like that.”

Morton connected deeply with many members of the clubhouse. Right-hander Zach Eflin, whose locker is next to Morton’s, called him a “one-of-a-kind” player for how thoughtful he is in postgame press conferences with members of the media, and Eflin said Morton is the same way with teammates in everyday conversation.

Even at Morton’s lowest, he stood out for his honesty and care. That doesn’t wash away the results from earlier in the season, but it is commendable. And because of how he turned his season around — and considering the prospect return — Morton can still be remembered for his best moments in Baltimore.

“You guys have been dealing with players struggling for a long time and I have to assume that you guys probably haven’t come across a lot of players that do handle themselves in the way that he did when he did struggle, with the media and owning it,” interim manager Tony Mansolino said. “Guys like Charlie, they stay in the big leagues for 20 years because they’re really good, they’re great players, but they also stay in the big leagues for 20 years because of their character. And I think in Charlie’s case I think we’ve seen the full spectrum of it all here over the last four or five months.”