"Tomas is delighted with the transfer," Dalibor Lacina said, adding that the player would be officially presented by the Spanish club on July 10.
Atletico confirmed Ujfalusi would be joining soon on their website.
The stand-in Czech captain during the recently-concluded UEFA EURO 2008 decided to move on from Fiorentina at the end of the last season after his contract with the Italian club expired. He did not reveal where he would be heading at the time but was already linked with Atletico Madrid.
The 30-year old defender temporarily replaced injured playmaker Tomas Rosicky as captain for the European championships following consultations by the then national coach, Karel Bruckner, with senior players.
Ujfalusi helped Fiorentina win a UEFA Champions League place for next season, ahead of AC Milan, and reach the UEFA Cup semi-finals.
He made his international debut in 2001 and has since been capped 71 times.