The Braves traded for Arizona starting pitcher Trevor Cahill late Thursday, sending minor league outfielder Josh Elander to the Diamondbacks in exchange for the former All-Star right-hander who is coming off a career-worst season.

The Diamondbacks will send $6.5 million to the Braves in the trade to cover more than half of Cahill’s $12 million salary in 2015, and the right-hander will be eligible for free agency after the season.

Despite his 3-12 record and 5.61 ERA in 2014, the Braves think Cahill, 27, can have a bounce-back season working with pitching coach Roger McDowell, who’s had a lot of success getting other sinkerballers back on track in the past.

“We saw his last outing, where he showed a real good fastball to 94 (mph) with real good sink,” Braves assistant general manager John Coppolella said. “We thought he was kind of a good buy-low, based on the fact he’s still young. He’ll be in a free-agent walk year.”

He is 64-69 with a 4.07 ERA in 186 games (170 starts) over six seasons with Oakland and Arizona, including 18-8 with a 2.97 ERA in 2010. That was followed by 25 total wins during consecutive 200-plus inning seasons in 2011 and 2012 with an ERA near 4.00 in that span.

Cahill had a hip injury that limited him to 146 2/3 innings in 2013 (8-10, 3.99 ERA) and was demoted to the bullpen for a period last season after struggling mightily in the rotation.

He pitched only 110 2/3 innings in 32 games (17 starts) in 2014, and there were concerns about the health of his shoulder, which the Braves were satisfied with after scouting four of his starts this spring and examining his medical records.

With Cahill, the Braves can avoid starting the season with both of their similar left-handed non-roster invitees, Eric Stults and Wandy Rodriguez, in the back two spots of their rotation behind the trio of Julio Teheran, lefty Alex Wood and Shelby Miller.

Both Stults and Rodriguez have opt-out clauses in their contracts that allow them to become free agents Friday if they choose, and Coppolella wouldn’t say whether the Braves had decided which of Stults or Rodriguez would be in the rotation and if the Braves planned to keep both of them. Manager Fredi Gonzalez earlier indicated that Rodriguez would be the fourth starter, but backed off of that some in the past week.

Stults and Rodriguez don’t throw hard and rely on location and change of speed. The Braves were reluctant to begin the season with both in the rotation. One, yes. But not both if they could help it.

Elander was a sixth-round draft pick in 2012 out of Texas Christian University, and hit .275 with a .356 on-base percentage and 21 home runs in 870 plate appearances over three seasons, none above high Single-A.

He was the Braves’ minor league player of the year in 2013 after hitting .293 with 15 homers and 93 RBIs in 135 games between low-A Rome and high-A Lynchburg in 2013, and was rated the Braves’ No. 13 prospect by Baseball America entering the 2014 season.

But Elander slipped to .219 with two homers in 37 games at Lynchburg in an injury-shortened 2014 season and was not rated among the team’s top 30 prospects this winter even before trades brought a slew of prospects that displaced about half of those who would’ve otherwise been in the top 20.