LAS VEGAS (AP) — Seattle Mariners general manager Jerry Dipoto was in the hospital, making a trade from a bed.

Cleveland counterpart Chris Antonetti was boarding a plane headed back home, trying to finalize the deal before the flight pulled away from the gate.

They managed to complete the swap as the winter meetings came to an end. Carlos Santana was sent back to Cleveland, where he was an Indians fan favorite. Edwin Encarnacion is headed to Seattle — no telling how long he’ll stick there.

The star hitters were dealt for each other Thursday, part of a three-team trade that also involved Tampa Bay.

The Rays got infielder Yandy Diaz and minor league right-hander Cole Sulser from Cleveland. The Indians also acquired first baseman Jake Bauers from Tampa Bay, while the busy Mariners wound up with a draft pick. Tampa Bay will send $5 million to Seattle and the Mariners will pay $6 million to Cleveland.

“I called Edwin earlier this morning before we had final sign-off because again I wanted him to hear from me,” Antonetti said after landing, adding he was in mid-flight when he finally reached Diaz.

Dipoto made likely the first winter meetings deal from a medical facility since then Jim Hendry’s agreement with pitcher Ted Lilly in 2007 when the then-Chicago Cubs general manager was taken for angioplasty in 2006. Dipoto felt ill a day earlier and was checked “out of an abundance of caution,” the team said.

“We’ll see how it goes with Edwin, whether he stays with us or he moves on to another destination,” Seattle assistant general manager Justin Hollander said.

Coming off their third straight AL Central title, the Indians had been expected to make a move at the meetings, presumably with ace Corey Kluber or pitcher Trevor Bauer.

Instead, they jettisoned Encarnacion — the designated hitter has averaged 108 RBIs over the last seven seasons — and brought back the popular Santana.

Philadelphia sent Santana to the rebuilding Mariners this month in a trade that included All-Star shortstop Jean Segura. Seattle quickly parted with Santana, who was appreciated by Indians rooters even more after he left.

Encarnacion had 107 RBIs while hitting 32 homers and .246. He leads the majors in homers and RBIs since 2012, and could provide the power lost when DH Nelson Cruz became a free agent.

A month before he turns 36, Encarnacion is guaranteed $25 million: $20 million next season and a $5 million buyout of a $25 million club option for 2020.

Seattle gets a competitive balance round B draft pick, currently projected at 77th overall. The Mariners, who recently traded star second baseman Robinson Cano and closer Edwin Diaz, said getting that choice was key to them making the deal.

“By adding another draft pick for 2019, we have another opportunity to add to the talent in our minor league system,” Dipoto said in a statement.