In exchange for landing the four-time 30-goal scorer, the Senators dealt forwards Jakob Silfverberg, Stefan Noesen and their first-round pick in next year's draft to Anaheim.
ESPN.com's Pierre LeBrun earlier reported the trade.
The Ducks also re-signed Saku Koivu to a one-year contract.
The Ducks announced they had signed the 38-year-old forward on Friday, after the start of the NHL's free-agency period. Koivu is a 17-year NHL veteran, who returns for a fifth season in Anaheim.
Koivu had 27 points (eight goals, 19 assists) in 47 games last season, while also breaking the 800-point plateau for his career. Overall, he has 244 goals and 559 assists in 1,058 career games.
He spent his first 13 seasons with Montreal, after being selected in the first round (21st overall) in the 1993 draft.
The Ryan trade was completed hours into the start of the NHL's free-agency period, and shortly after Alfredsson, the Senators longtime captain, signed a one-year deal with the Detroit Red Wings.
Ryan was selected with the No. 2 pick by Anaheim in the 2005 draft. He has combined for 289 points (147 goals, 142 assists) in 378 career games.
Ryan hinted at the trade on his Twitter account by posting a note that read:
Ottawa.... Im coming in hot
— Bobby Ryan (@b_ryan9) July 5, 2013
Ryan had been linked in trade talks with numerous teams over the past two seasons. He has two years left on a five-year, $25 million contract. Though losing the 40-year-old Alfredsson was a blow for the Senators, they countered by getting a younger offensive threat in the 26-year-old Ryan.
He joins a team that already features a top-line scoring star in Jason Spezza, and a young core of players. It's a group that includes Milan Michalek and 2012 Norris Trophy-winning defensman Erik Karlsson. And they're coach by Paul MacLean, this year's NHL coach of the year.
The Senators showed perseverance last season, overcoming injuries to Spezza and Karlsson to qualify for the playoffs.
Silfverberg is a top up-and-coming player and coming off a solid rookie season in which he had 10 goals and nine assists in 48 games.
He was selected in the second round of the 2009 draft. Noesen, from Plano, Texas, was Ottawa's first-round pick in the 2011 draft. He had 38 goals and 44 assists for 82 points in 63 games in completing his third season with Plymouth of the Ontario Hockey league.
Information from The Associated Press was used in this report.