The Chicago Cubs and president of baseball operations Theo Epstein have agreed to a five-year contract extension.

Epstein's initial contract -- signed in 2011 as a five-year deal worth $18.5 million -- was set to expire at the end of this season, and his status was one of the few unanswered questions of the Cubs' season so far.

"It's everything I could have asked for. There is no place I'd rather be," Epstein told reporters Wednesday. "I'm thrilled this worked out."

Epstein and Cubs owner Tom Ricketts first discussed the extension during spring training and then at various points during the summer.

"I told him I thought he was the best in the game at what he did, and he told me no matter what I paid him he wasn't going to leave Chicago, so we were off to a good start," Ricketts said. "The time and energy to do it the right way has paid off with a team that should be successful for years to come."

While terms of the deal were not disclosed, Today's Knuckleball reported that it will pay Epstein a little less than $50 million over the five years, although incentives could take him over that number.

"I think it's in the range, it's competitive and where it should be for someone who I think is the best baseball executive in the game," Ricketts said.

"The thing that I've seen the last five years is how well he handles people, how well he chooses people for his [front office] team, how well he chooses players for his team. And his ability to judge character and put together the right human resources on the same team has been truly remarkable."

Chicago Cubs president of baseball operations Theo Epstein has agreed to a five-year contract extension. After posting a losing record in each of his first three years at the helm, the division champ Cubs are playoff-bound for the second straight year. Andrew Hancock for ESPN

The National League Central champions are on pace to finish the season with the best record in baseball by a wide margin. They head into the postseason as a team without a glaring weakness: great offense, stellar defense, outstanding rotation, the best relief corps in baseball and a canny manager in Joe Maddon.

The team's 100-and-counting wins this season marks the first the time club has broken the century mark since 1935.

Epstein was a former front-office man for the Boston Red Sox, becoming the youngest general manager in MLB history in 2002. He is widely credited with building the squads that won the 2004 and 2007 World Series.

Epstein resigned from Boston in 2011 to become president of baseball operations for the Cubs. During Epstein's first three years at Wrigley, the team finished in last place in the NL Central. Last season, it advanced to the National League Championship Series as a wild-card team but was swept by the New York Mets.

Epstein said this was a pretty easy negotiation because he wanted to stay in Chicago.

"I told [Ricketts] if we couldn't work out a contract it would get awkward, because I would still keep showing up to work as an employee at will ruining my leverage," Epstein said.

The team also gave extensions to general manager Jed Hoyer and vice president of amateur scouting and player development Jason McLeod.