Roster spots are at a premium for the Phillies, so much so that they released lefthander Matt Harrison on Tuesday, a transaction that could cost the team millions but help them retain a younger player.

Harrison, a veteran starter acquired from the Texas Rangers as part of the Cole Hamels trade in 2015, never threw a pitch for the Phillies because of a chronic back injury. He was included in the Hamels trade as a means for the Rangers to find some salary relief while they surrendered a significant package of prospects.

But the Phillies kept Harrison because an insurance policy on his inherited contract stipulated that his employer could recoup some of Harrison's salary so long as the pitcher remained on the 40-man roster. He was slated to make $13 million in 2017, with a $2 million buyout to be paid in 2018. The insurance policy, a source said, did not cover the entire amount of the contract. But it would have refunded the Phillies at least half of the $15.2 million owed to Harrison.

The Phillies, two sources said, reached some sort of settlement with the insurance company that defrayed a portion of the $15.2 million sum.

Ultimately, the team ate a chunk of money to clear space for a younger player. They need every available 40-man roster spot in advance of Friday's deadline to protect players eligible for the Rule 5 draft. General manager Matt Klentak said last week he expected to add at least eight minor-league players to the roster. The number could be closer to 10, and maybe more.

Once Jeremy Hellickson accepted the Phillies' qualifying offer of $17.2 million, the 40-man roster stood at 33 players. Now it is 32. The Phillies are expected to clear more space before Friday's deadline.

They will add prospects Nick Williams, Dylan Cozens, Andrew Knapp, Ben Lively, Nick Pivetta, Mark Appel, and Elniery Garcia to prevent them from being selected in the Rule 5 draft.

Harrison, 31, had a 4.21 ERA in 135 career major-league games. He was an all-star in 2012. He made just nine starts after signing a five-year, $55 million contract with the Rangers in 2013.