The deal is worth a total of $15 million, with a $3.75 million yearly cap hit, a source told ESPN.com.
Halak, 25, will earn $2.75 million next season; $3.5 million in 2011-12; $4.25 million in 2012-13; and $4.5 million in 2013-14.
"Jaroslav will be a big help for our organization moving forward," Blues general manager Doug Armstrong said. "He has made a great commitment to the Blues as he enters the prime of his career."
Halak, who was a restricted free agent, was acquired from the Montreal Canadiens last month. The Slovak native led the Canadiens in upsetting heavily favored Washington and Pittsburgh this spring in the Stanley Cup playoffs.
Halak was 26-13-5 last season, and was fourth in the NHL in save percentage (.940); ninth in goals-against average (2.40); and tied for fifth with five shutouts.
"I've been looking forward to playing in St. Louis ever since the trade was announced," Halak said. "I believe in my abilities and hope to do some good things for the Blues."
In the trade, the Canadiens received two youngsters, center Lars Eller and winger Ian Schultz.
Eller, a center, was among the Blues' top prospects, and Schultz was a third-round pick in 2008.
In addition, the Blues announced they had re-signed forward Cam Janssen to a one-year contract extension and veteran defenseman Carlo Colaiacovo to a two-year extension. Colaiacovo had a career-high 32 points last season, with seven goals and 25 assists.
Janssen's deal is worth $600,000, a source told ESPN.com.
"St. Louis is my home and always will be," Janssen said. "We have a great group of guys and I'm looking forward to start the season."
Janssen, 26, played in 43 games last season and led the team with a career-high 190 penalty minutes.
Pierre LeBrun covers the NHL for ESPN.com.