The Royals are acquiring outfielder Blake Perkins, third baseman Kelvin Gutierrez and right-handed pitcher Yohanse Morel for Herrera, one of the most desirable bullpen arms available on the trade market.
Herrera has 14 saves and a 1.05 ERA this season for the Royals, with 22 strikeouts and just two walks over 25 2/3 innings. He is coming off a 2017 season in which he had a career-high 26 saves.
"He's really good. He's been really good this year, too, so I'm excited to have him," Nationals manager Davey Martinez said. "He's going to fit right in. He's closed games, he's come in in the eighth. For me, we have an All-Star closer right now, so he'll be asked to do some different things so he'll fit right in."
Martinez will now have two closer-type arms to choose from at the end of games. Sean Doolittle is having a strong season as the Nationals' closer, with 18 saves in 19 opportunities and a 1.47 ERA with 43 strikeouts in 30 2/3 innings.
Doolittle welcomed the addition of Herrera, saying it was "awesome" to add a World Series-winning closer to the bullpen.
"For the front office to send a message to us this far ahead of the deadline, to try to get us some help in the bullpen ... it's almost their way of saying, 'Here's some help. Here's some reinforcements.' I think it's one of those situations where you can't have too many options down there," Doolittle said.
Gutierrez, 23, is the 10th-ranked Nationals prospect, according to MLB.com. He is hitting .274 with 6 doubles, 3 triples, 5 homers, 26 RBIs, 16 walks, 10 stolen bases and 36 runs scored in 58 games with Double-A Harrisburg.
Perkins, 21, playing in Class A Potomac, is hitting .236 with 11 doubles, one home run, 21 RBIs, 40 walks and 38 runs scored in 63 games. Morel is just 17 and was signed by the Nationals as a nondrafted free agent in 2017.