A source told ESPN.com's Pierre LeBrun that the deal is for three years and $11.25 million. Krejci will receive $3.5 million the first year, $3.75 million the second and $4 million the final season of the deal.
On Thursday, the 23-year-old Czech will have surgery that will keep him out for four to six months.
Krejci said he hopes to be back for the start of the regular season, but he could miss the first month.
"I would like to return for the first game," he said in a conference call with reporters. "I might miss the first month. We'll see how it goes."
Bruins general manager Peter Chiarelli said he wasn't concerned about making a commitment to a player who is about to have surgery.
"He's a young man. He's a hard working guy. All the indicators from the medical people that we have were positive," Chiarelli said. "You put that in the equation and you make a decision to move forward."
The 23-year-old from the Czech Republic led the league last season with a plus/minus rating of positive 36. He was second to Marc Savard on the team with 51 assists and added 22 goals.
Taken in the second round of the 2004 draft, Krejci made his Bruins debut on Jan. 30, 2007. Last season he had 6-21-27 totals.
"I'm still young," he said. "Every year I can get bigger, stronger faster, and be a better player."
Chiarelli said he was impressed with Krejci's attitude when he was sent to the minors in 2007. Instead of getting upset, he worked at making himself better.
"And he got to be a much better two-way player," Chiarelli said. "He had a breakout year statistically. I think David feels he can still be better and take his game to another level."
Krejci was due to become a restricted free agent.
"This was the place I wanted to play next year," he said. "It's a good deal and I love the city and a place I want to play. So I'm very happy and excited for next year."
Chiarelli signed off the conference call by telling Krejci that he would call him to check in after the surgery. The GM said 21-year-old forward Phil Kessel, who had shoulder surgery after leading Boston with 36 goals, will begin his rehab Friday.
Pierre LeBrun covers the NHL for ESPN.com. Information from The Associated Press was used in this report.