Detwiler started the season in the rotation after an offseason trade with Washington for two Texas prospects. The 29-year-old went 0-5 with a 6.95 ERA in seven starts and was sent to the bullpen after a stint on the disabled list with shoulder inflammation.
After 10 more appearances as a reliever, Detwiler's 7.12 ERA was highest in the majors among pitchers with at least 40 innings.
The Rangers, who announced the move Saturday, have 10 days to trade, release or outright Detwiler to the minors. He spent his first seven seasons with Washington.
Mendez was on the opening day roster and went 0-1 with a 5.40 ERA in 12 outings before going to the minors.