The sides settled for $14.575 million, the midpoint between what Ortiz had asked for and what the Red Sox offered. The Red Sox offered $12.65 million (a slight raise from his $12.5 million salary in 2011) and Ortiz had asked for $16.5 million.
Ortiz became a free agent after the season then passed up a chance to go elsewhere when he accepted Boston's arbitration offer on Dec. 7.
"I feel happy since I avoided going to arbitration," he said on Monday, hours before the hearing had been scheduled to start in St. Petersburg, Fla. "People are used to seeing me with the Red Sox uniform and when you have so much time in one organization, and you're identified with it, the best thing is to stay, even if it is for $1 or $2 million less."
The Red Sox have not gone to an arbitration hearing in 10 years and have no unsigned players eligible for arbitration.
"It's just one of those things that when we all had everyone in the room together, it just made sense that we would get to the midpoint and get it done," Red Sox general manager Ben Cherington said, according to the Boston Globe.
Cherington said that the team "made that clear again to him" that the team wanted Ortiz to return.
Ortiz's agent, Fernando Cuza, told reporters that "both sides are very happy with the deal and we'll leave it at that. This is a process and once we got together and talked it out, it made sense to get a deal done and move on."
Ortiz had been seeking a multiyear deal, but Cuza would not comment on whether that subject was broached in discussions with the team.
A team source told ESPNBoston.com's Gordon Edes that the Red Sox remain actively interested in signing free agent pitcher Roy Oswalt, and that the Ortiz settlement won't be a factor in those talks. "Roy just needs to figure out where he wants to play," the source said.
Ortiz had one of his best seasons in years in 2011. He batted .309 with 29 home runs, 96 RBIs and a .952 OPS.
Signed as a free agent from the Minnesota Twins in 2003, the 36-year-old is entering his 10th season with the Red Sox.
"I figured I was gonna reach this deal, and that's what we're celebrating right now," Ortiz said.
He played last season in the option year of a contract that paid him $65,225,000 over five seasons.
Ortiz remains in the middle of a Red Sox lineup that has undergone several changes since the team went 7-20 last September and missed the playoffs on the final day of the regular season.
Left fielder Carl Crawford is expected to miss the start of the season after surgery on his left wrist; shortstop Marco Scutaro was traded to Colorado; and catcher Jason Varitek and right fielder J.D. Drew were not re-signed.
But the first five batters in the lineup return, led by center fielder Jacoby Ellsbury, who finished second in the AL MVP voting. Also back are second baseman Dustin Pedroia, first baseman Adrian Gonzalez and third baseman Kevin Youkilis.
Ortiz had an outstanding season after getting off to poor starts the previous two years.
He finished fourth in the AL in slugging and on-base percentage and sixth in batting average. His average, homers, RBIs, 162 hits, 70 extra-base hits, 40 doubles, .398 on-base percentage and .554 slugging percentage were all his highest totals in four years.
Ortiz is fifth in team history with 320 homers, 59 behind Dwight Evans for fourth place, and sixth with 1,028 RBIs, 219 behind Bobby Doerr for fifth place.
He accepted Boston's offer of arbitration under the last year of the old collective bargaining agreement. Starting this fall, instead of arbitration, teams may give their players qualifying offers equal to the average salary of the top 125 players ranked by salary.
Boston also has agreed to a minor league contract with right-hander John Maine, who has not been asked to attend big league camp.
Information from The Associated Press was used in this report.