The defending World Series champion Houston Astros just got better.

It took weeks of negotiations to complete, but the Astros acquired right-hander Gerrit Cole in a trade with the Pittsburgh Pirates, according to a baseball official with direct knowledge of the deal.

The official spoke to USA TODAY Sports on the condition of anonymity because the trade has not been finalized.

In return, the Pirates received pitchers Joe Musgrove, Michael Feliz, outfielder Jason Martin and third baseman Colin Moran.

Cole, 27, has two years remaining before becoming a free agent. He was highly sought out this winter by multiple teams - most notably the New York Yankees.

On Friday, Cole avoided arbitration by agreeing on a one-year deal worth $6.75 million. He went 12-12 with a 4.26 ERA and made a career-high 33 starts in 2017. His best season was 2015, when he went 19-8 with a 2.60 ERA and 202 strikeouts.

He joins a rotation fronted by former Cy Young Award winners Dallas Keuchel and Justin Verlander. Including Right-handers Lance McCullers Jr., Charlie Morton and Brad Peacock, it gives the Astros depth in the rotation.