The Yankees and Cubs have officially agreed to deal that will send Alfonso Soriano back to The Bronx where he started his career.

The Yankees will pay $8-12 million of the $24.5 million still owed the outfielder over the next season and a half. In exchange the Cubs will get a mid-level prospect or two. There has been speculation the deal would include minor league pitcher Chase Whitley but a source said he is not part of the deal.

Soriano wasn’t in the Cubs’ lineup Wednesday night in a 7-6 Cubs win over the Diamondbacks. Monday night a source told The Post the Cubs and Yankees were close on a deal.

With Curtis Granderson on the way back from the disabled list and possibly ready to play by the first week in August Soriano’s main job will be as the designated hitter and the hope is he can add muscle to an anemic lineup.

Because Travis Hafner has been in a two-month free fall the right-handed hitting Soriano could become the full-time DH. Because the Yankees will have three left-handed hitting outfielders when Granderson comes back Soriano could play left field against left-handed pitchers.