Bernier had been stuck behind Jonathan Quick in Los Angeles. The Maple Leafs, according to general manager Dave Nonis, were interested in upgrades at any position.
"I think it's incumbent upon every team to look at what's available and if there is an ability to improve you look to do it," Nonis said last week after the GM's meetings in Boston.
Toronto gave up forward Matt Frattin, backup goaltender Ben Scrivens and a second-round pick in the 2014 or 2015 NHL entry draft.
The 24-year-old Bernier is eligible to become a restricted free agent. He played in 14 regular-season games for the Kings in 2012-13, compiling a 9-3-1 record with a goals-against average of 1.88 and save percentage of .922.
Kings assistant GM Ron Hextall said the deal had been "ongoing for months."
"It's kind of bittersweet. Jon's been with us a long time. He's been a great soldier for us and he's been a very good player for us," Hextall said in a video on the Kings' website.
"Unfortunately, he's stuck behind Jonathan Quick, which is a tough situation for Jon. As a sense of fairness to him and at the timing that we felt was the best for the organization, we made the move."
Scrivens, 26, played 20 games for the Maple Leafs this past season with a 7-9 record. Frattin, 25, had seven goals and six assists in 25 regular-season games for the Leafs in 2012-13.
"Just want to thank MapleLeafs for a first class experience to start my pro career," Frattin tweeted. "Very excited to join LAKings."
Bernier was taken by the Kings in the first round (11th overall) of the 2006 draft. He played in 62 career regular-season games with the Kings, compiling a 29-20-6 record, .912 save percentage, 2.36 goals-against-average and six shutouts.
The trade raises questions about the status of James Reimer, who was Toronto's No. 1. The Maple Leafs signed the 25-year-old Reimer to a three-year contract extension in June 2011.
Bernier made $1.5 million this season compared with $1.6 million for Reimer. Frattin earned $850,000 while Scrivens made $600,000.
Toronto's situation in goal has been unsettled in recent years with the likes of Reimer, Jonas Gustavsson, Jean-Sebastien Giguere, Andrew Raycroft, Vesa Toskala and Justin Pogge.
Reimer, whose career has been slowed by injuries, went 19-18-5 this season with a 2.46 goals-against average and .934 save percentage. He also helped the Leafs take the Bruins to the seventh game of the opening round of the playoffs.
The Bruins won, with former Maple Leafs draft choice Tuukka Rask starring for Boston in the playoffs.