The deal was confirmed by the team on Friday.
The 36-year-old Ayala was 1-1 with a 2.90 ERA and two blown saves in 37 games with Atlanta in 2013 after beginning the season with Baltimore. He began his major league career with the Montreal Expos in 2003 and previously pitched for the Nationals from 2005-08.
Ayala has pitched in relief in each of his 534 games with Montreal, Washington, the New York Mets, Minnesota, Florida, the New York Yankees, Baltimore and Atlanta. He has a 38-47 career record and 3.34 ERA.