The well-traveled Diekman, 32, joined the Royals as a free agent this winter and had been one of the most popular players on the trade market leading up to the July 31 deadline because of his coveted fastball-slider mix.
Oakland pounced and will send two prospects -- outfielder Dairon Blanco and right-handed pitcher Ismael Aquino -- to Kansas City. Blanco, 26, who was signed as an international free agent in 2017, was batting .276 with 44 RBIs and 27 stolen bases for Double-A Midland this season. Aquino, 20, was 1-1 with a 4.58 ERA over 10 appearances in the Arizona League.
Entering Saturday's games, Oakland (58-47) was eight games behind the Houston Astros in the American League West. The Athletics, however, were tied with the Boston Red Sox for third place in a heated wild-card chase -- just a half-game behind the Tampa Bay Rays for the final spot.
While Diekman's 4.75 ERA is below league average, his 13.6 strikeouts per nine innings ranks 11th among relievers and he also ranks in the top 25 in lowest home run rate. Diekman's biggest bugaboo has been control, as he is walking nearly 5 batters per nine innings, in line with his career numbers.
With Diekman, Blake Treinen, Liam Hendriks and Lou Trivino, the A's are assembling one of the hardest-throwing bullpens in the major leagues, hoping to ride it to the postseason as they did last year.
"I played against that team basically for three years,'' said Diekman, who has spent a large part of his career with Texas. "I know the division really well. I know how good that team is. I'll just go there and hopefully continue the success they've had there and see where we end up at the end of the year.''
Oakland's 3.94 bullpen ERA ranks seventh in the majors.
This is the second trade this month between Kansas City and Oakland. The A's acquired starter Homer Bailey for infielder Kevin Merrell on July 14.
"We've talked for a while about wanting to add to the bullpen. Jake was someone that we had engaged with in the offseason as a free agent and has pitched really well for Kansas City,'' A's general manager David Forst said Saturday. "... We've been talking to Kansas City for a while, back when we started talking about Homer. Jake was also part of those discussions and we ended up separating them. This time of year just about everybody's going to be looking to add to their bullpen so you're always competing with other teams. I thought we did a good job of staying pretty patient with Kansas City over the last week and we're happy to get the right package for them.''
Diekman signed a one-year, $2.25 million contract, which included a mutual option for 2020, with the Royals in the offseason. He has also pitched for the Philadelphia Phillies, Texas Rangers and Arizona Diamondbacks and has a career 3.87 ERA.
Kansas City also recalled oft-injured pitcher Kyle Zimmer and first baseman Ryan O'Hearn from Triple-A Omaha. Struggling first baseman Lucas Duda was designated for assignment.
"There's a lot of shakeup the last couple of days,'' Royals manager Ned Yost said. "Our plan all along was to get close to the trade deadline and maybe get O'Hearn back up here, maybe get Zimmer back up here. For sure get [pitcher Richard] Lovelady back up here. All those things have happened.
"The trade of Diekman gives him the chance to be part of a pennant race, as it did Homer. It was just time for O'Hearn. He's been playing well down there. We wanted to make sure we gave Lucas Duda the chance to get into an organization. He may have a chance to be playoff-bound. We made that move three or four days before the trade deadline so he could hook on with a team.''
Duda was hitting just .171 with four homers and 15 RBIs in 39 games this season.
Zimmer, the fifth overall pick of the 2012 draft, has struggled through injuries for most of his career. He pitched well in spring training and earned a spot on the big league roster, but he was 0-1 with a 9.00 ERA in three relief outings before he was sent back to the minors.
O'Hearn has had brief stints with the Royals each of the past two seasons. But with Duda gone and Cheslor Cuthbert primarily at third base, he hopes to stick at first base this time.
"It was tough. No doubt. There was a two-week period where I woke up every day frustrated with it,'' O'Hearn said of the minor league stint. "At the same time you have to understand that it's part of the game. I'm not the first guy this has happened to. I just had to understand that it was for the better. I worked on stuff every day and I think I got a lot better."
The Associated Press contributed to this report.