The worst-kept secret in baseball is finally, officially out in the open. The Red Sox and Cubs issued a joint statement Friday night announcing Theo Epstein has resigned from his post as Boston’s general manager to become the Cubs’ president of baseball operations.  Read more after the jump.

@Shay_Marie x @gametimegirl

The move is “effective immediately,” according to the statement. The teams won’t hold news conferences until Tuesday, the next off day in the World Series, when the Cubs will presumably introduce Epstein in Chicago. Major League Baseball generally prohibits announcements during the World Series, but Friday is a day off between Games 2 and 3 between the Cardinals and Rangers.

A source told ESPNBoston.com’s Gordon Edes that Red Sox assistant GM Ben Cherington will be named Epstein’s successor. Boston, which collapsed in September and missed the playoffs for a second straight year, must find a manager to replace Terry Francona.

Epstein’s deal has been held up for more than a week as the teams haggled over compensation the Red Sox would receive for letting Epstein out of his contract. Those negotiations continue even as Epstein leaves his hometown Red Sox. According to the joint statement, the teams “have reached an agreement regarding a process by which appropriate compensation will be determined for the Red Sox and that issue will be resolved in the near term.”

The Red Sox aimed high in asking for compensation for Epstein. A baseball source told ESPNBoston.com they initially asked for the Cubs shortstop, Starlin Castro. When they were rebuffed, the Red Sox asked for Cubs starting pitcher Matt Garza.

A major league source told ESPNChicago.com that at one point Boston proposed that the Cubs take pitcher John Lackey’s contract. Lackey has three seasons remaining on an $82.5 million deal. He was 12-12 with a 6.41 ERA in 28 starts for the Red Sox in 2011.

But the expected agreement will include Cubs minor leaguers, although not top prospects Brett Jackson, Trey McNutt or Matt Szczur, the source said. Cash will not be part of the compensation.

What is clear is that Jed Hoyer will be Epstein’s general manager in Chicago. A baseball source told ESPNBoston.com that the current Padres GM would be granted permission to leave when San Diego promotes senior vice president of baseball operations Josh Byrnes to vice president/GM. Byrnes was GM of the Arizona Diamondbacks when Padres owner Jeff Moorad was part-owner of that team. Sources said Moorad has wanted Byrnes to return to the job, even though he respected Hoyer, whom he hired in 2010.

A source told ESPNBoston.com that Epstein asked Byrnes to join him in Chicago, but Byrnes declined. Epstein then turned to Hoyer, his longtime friend and former assistant. Hoyer went to Moorad, told him of the offer from Epstein and said he would stay if the Padres gave him a five-year extension. Moorad, though reluctant to lose Hoyer, the source said, said he would not grant him the extension and told him he was free to take the Cubs’ job.

In another Cubs staffing development, ESPNBoston.com has confirmed that Padres assistant GM Jason McLeod will also join Epstein and Hoyer in Chicago.

There would be no compensation for Hoyer, a source told ESPNChicago.com and ESPNBoston.com.

Byrnes and Hoyer worked with Epstein in Boston. Hoyer took over as Padres GM in 2010 after Kevin Towers was fired. McLeod worked for the Red Sox in the scouting department for seven years before going to the Padres. One remaining piece missing from Epstein’s original team of key advisors is Red Sox special assistant Dave Finley, who could also be in play for Epstein in Chicago.

The 37-year-old Epstein resigned with a year remaining on his contract as Red Sox general manager to run a team that has gone 103 years without a World Series championship. He will reportedly receive a five-year deal worth about $18.5 million to overhaul the baseball side of the Cubs’ front office.

With Epstein at the helm, the Red Sox ended an 86-year World Series championship drought in 2004 and won the title again in 2007.

Cubs fans can only hope he will do the same thing on the North Side. Cubs chairman Tom Ricketts fired GM Jim Hendry in July after another disappointing season.

One of Epstein’s first chores in Chicago is the future of manager Mike Quade, who led the team to a 71-91 record in his first full season. He has another year left on his deal.

While the Red Sox pick up the pieces of a collapse that includes reports of locker room disharmony and the departure of Francona, Epstein will have a long list of things to do in Chicago.

Read more on ESPN