Earlier in the day, the Nationals dealt infielder/outfielder Jerry Hairston Jr. to the Brewers for outfielder Erik Komatsu.
Before the trade with the D-backs, Walters, who was drafted in the ninth round of the 2010 First-Year Player Draft, was playing with Class A South Bend, hitting .302 with nine home runs and 56 RBIs. He will play for Class A Potomac in the Nationals' system.
Walters is a prospect the Nationals have scouted extensively dating back to when he attended San Diego University and was a teammate of left-hander Sammy Solis, who was Washington's second round pick in the 2010 Draft.
"He is a switching-hitting middle infielder that has some bat ability, some power," general manager Mike Rizzo said about Walters. "He is a good instinctual ballplayer, who could stay in the middle of the diamond and be a run producer."
On the other side, Marquis was a player who the Nationals needed to trade. He is a free agent at season's end, and the Nationals would not have received compensation for him.
"Going to Arizona, I'm in a good position to make a run for the playoffs," Marquis said. "I'm excited about it, but I enjoyed my time in Washington. I have some good friends [on the team]. ... It's part of the game and part of the business. Now I have to do my job with the Diamondbacks."
In 20 games for Washington, Marquis was 8-5 with a 3.95 ERA.
It's been a comeback season for Marquis. Last year, he pitched in only 13 games because of bone chips in his right elbow.
"Last year was a little frustrating, being injured for the first time in my career," Marquis said. "I did a lot of work to make sure that I was the old Jason Marquis. This year turned out the way I wanted. I'm throwing the ball the way I wanted. I'm going to continue to get better, work hard between starts."
Marquis was scheduled to start for the Nationals on Saturday against the Mets. But after the trade, right-hander Yunesky Maya was called back from the Minors to make the start. Maya returned from Triple-A Syracuse, where he was 1-7 with a 5.32 ERA. After Saturday's start, Maya is likely to return to Syracuse.
Rizzo acknowledged that the several teams, including the Tigers and Indians, had interested in Marquis.
"It was a mixed bag with the players. Jason really adopted this place as his second home," Rizzo said. "He really loved the clubhouse and loved the community. He was a little disappointed, but he was also excited [about] pitching meaningful games at the end of the season on a contending club and making it to the playoffs."
Marquis goes to a city where he was involved in controversy on June 5. During Washington's 9-4 victory in Phoenix, the game was overshadowed by the high number of batters being hit by pitches. Marquis was ejected after hitting D-backs outfielder Justin Upton in the sixth inning.
Home-plate umpire Rob Drake issued warnings in the top of the fifth after D-backs right-hander Ian Kennedy hit Jayson Werth with a pitch. It marked the third time Werth was hit in the series.
In the sixth inning, with Washington leading, 1-0, Kelly Johnson walked with one out. Marquis then hit Upton on the lower back with a pitch. Upton fell to the ground in pain, and Drake ejected Marquis and then-manager Jim Riggleman. Both Marquis and Riggleman argued with Drake, claiming Marquis did not hit Upton on purpose. It marked the fourth time Upton was hit by a pitch in the four-game series.
Marquis doesn't think he will have any problems with Upton once he arrives in Arizona. Marquis said he had problems griping the ball because of the hot weather.
"Obviously, I didn't do it intentionally," Marquis said. "There is no reason for him to be mad. We'll probably talk about it, joke about it. In between the lines, it stays between the lines. Nothing personal."
Bill Ladson is a reporter for MLB.com and writes an MLBlog, All Nats All the time. He also could be found on Twitter @WashingNats. This story was not subject to the approval of Major League Baseball or its clubs.