The Texas Rangers have acquired right-hander Ryan Dempster from the Chicago Cubs, multiple sources reported minutes before the 4 p.m. ET trade deadline.

Class A third baseman Christian Villanueva and Class A right-hander Kyle Hendricks will go to the Cubs in the trade, Evan Grant of the Dallas Morning News reported. The deal was initially reported by ESPN's Buster Olney, MLB.com's Ken Gurnick and Scott Miller of CBS Sports.

The Atlanta Braves and Los Angeles Dodgers were favorites to acquire Dempster, but the Rangers jumped in late and got the 35-year-old. Dempster had to waive his no-trade clause to approve any deals.

Dempster is 5-5 with a 2.25 ERA in 104 innings pitched this season.