The teams announced the trade Sunday afternoon.
"Surprised but excited, going to a team that is one game out of the playoffs," Alonso said after the trade, according to the San Francisco Chronicle. "I get to play some meaningful baseball, which will be probably the first time in my career I'll be able to do that. I'm ecstatic."
The Mariners, who have not been in the playoffs since 2001, entered a Sunday doubleheader at Kansas City trailing the Royals by 1½ games for the second wild-card spot.
Alonso, 30, is having a breakthrough power season while playing on a one-year contract, batting .266 with a career-high 22 home runs and 49 RBIs. His previous career high for homers in a single season was nine in 2012 with the San Diego Padres.
"I can't thank the Oakland A's enough for the opportunity they gave me," Alonso said. "They believed in me and helped me mature and recharge my career."
Alonso has seen a power dip since the All-Star break, with only two home runs and a slugging percentage that has dropped to .377; he slugged .562 before the break. He still ranks second among American League first baseman with a .527 slugging percentage on the season.
A left-handed hitter, Alonso could platoon at first base with former Athletics teammate Danny Valencia.
With Danny Valencia hitting .256/.300/.389 against RHP, the Mariners have needed a platoon partner all season at first base. Yonder Alonso has slowed down after an All-Star first half, but he should provide at least a small upgrade over Valencia against righties. Keep in mind that the Mariners have a brutal August schedule, including a 12-game road trip later this month, so the goal is to hang close until September.
Powell has hit .194 with no home runs and two RBIs in 23 games with the Mariners this season. He has spent most of the season with Triple-A Tacoma, hitting .340 in 58 games. Powell was a 2012 draft pick of the A's and has now been traded three times over the past 19 months.
The A's will host the Mariners for a two-game series starting Tuesday.
In another trade, the Mariners acquired right-handed pitcher Ryan Garton and catcher Mike Marjama from the Tampa Bay Rays in exchange for Double-A pitcher Anthony Misiewicz, low Class A infielder Luis Rengifo and a player to be named.
The Associated Press contributed to this report.