However, it was at Udinese where he really began to make an impact as a manager. During the 2004–05 season, Spalletti guided Udinese to a sensational fourth-placed finish in Serie A, exceeding expectations and securing a spot in the Champions League.
Such success for a traditionally unexceptional side with limited resources attracted the attention of Roma. The capital side had come off a disappointing season, in which four different coaches had spells in charge of the club. Spalletti was offered the task of attempting to bring order to this chaotic side. After an uninspiring first half of the 2005–06 season, he changed the team's tactics to attacking rather than defensive, but starting playing without any real striker (with an attacking midfielder as striker). On 26 February 2006, Roma broke the Serie A record for consecutive wins (11) with a 2–0 victory over Lazio. However, by the end of the season, Roma failed to reach 4th place, therefore failing to qualify for the UEFA Champions League. Spalletti also took Roma into the Coppa Italia final against Inter during the 2005–06 season but lost. However, Roma qualified for the 2006–07 UEFA Champions League, since Juventus was relegated and Fiorentina and A.C. Milan received point deductions, all as a result of the Serie A match-fixing scandal. Spalletti's favoured formation is the 4–2–3–1 system, where he uses 4 defenders, 2 defensive midfielders, 2 wingers (both sides of the 3), 1 attacking midfielder, and 1 striker (Francesco Totti, another attacking midfielder, or without any real striker). This system proved effective upon its introduction during the 2005–06 season for Roma. As a result, the team climbed from 15th place in the table to 5th by the end of the season. During that time, Roma also went on an 11-match winning streak. At the end of 2006, Spalletti was elected Serie A Coach of the Year and, in the following months, led Roma until the Champions League quarter-final after a 2–0 victory over Lyon at the Stade Gerland in the first knockout round. The team, however, succeeded in becoming the first team to defeat Roberto Mancini's Internazionale in all competitions that year, emerging with a 1–3 result at the San Siro, a match that the Nerazzurri had to win to mathematically claim the 2007 Scudetto against the only credible rival they had in the championship. Roma would also win the Coppa Italia against Inter, with an aggregate result of 7–4; a resounding 6–2 in the first leg in Rome and followed by a narrow 2–1 defeat in Milan. It was the first important trophy in Spalletti's career, who only had won a Coppa Italia di Serie C with Empoli. But he was yet to add another piece of silverware to his cabinet, as Roma would again defeat Inter 0–1 in Milan in the 2007–08 to steal their Supercoppa Italiana crown. In the 2007–08 Champions League first knockout round, Spalletti's Roma team became the first Italian team to defeat Real Madrid over two legs (2–1 in both ties in Rome and Madrid) and consequently also became the first European side to record two victories over Real Madrid in their Santiago Bernabéu home ground. In a repeat of the previous season's quarter final, Roma were again eliminated from the Champions League by eventual winners Manchester United. They did, however, succeed in their defence of the Coppa Italia, once again defeating Scudetto winners Inter in the final — a single match which Roma won 2–1. In the 2008–09 season, Spalletti faced a very difficult season with Roma. At the end of the season, the team only managed to qualify for the Europa League with a 6th-place position in the league, after a very struggling initial period that left the giallorossi in the bottom half of the league for the first part of the Serie A season. The new season saw Spalletti struggling with a limited squad, that was weakened further by the sale of Alberto Aquilani to Liverpool, and compounded by serious financial problems for the club. Roma started the season by taking part in two 2009–10 UEFA Europa League qualifying rounds, both easily won against Gent (10–2 on aggregate) and Košice (10–4 on aggregate); however, another poor start in the 2009–10 Serie A season, with two consecutive defeats (2–3 to Genoa and 1–3, at home, to Juventus) persuaded Spalletti to resign on 1 September 2009.
On December 2009, it was confirmed Spalletti would join Zenit on a three-year deal, replacing interim coach Anatoly Davydov with Italian coaches Daniele Baldini, Marco Domenichini, and Alberto Bartali also joining the Russian club. The Board of Zenit wanted him to return the Russian Premier League title, win the Russian Cup, and go through the group stage of the Champions League in his first year. Zenit won the Russian Cup on 16 May 2010, beating FC Sibir Novosibirsk in the final (having beaten Volga Tver in the quarterfinal and Amkar Perm in the semifinal). After 16 games in the 2010 Premier League, with 12 wins and four draws, under Spalletti Zenit have obtained 40 points. This set a new Russian Premier League record for most points won at that stage of the campaign. In the summer transfer window of 2010, Spalletti made his first signings: forward Aleksandr Bukharov and midfielder Sergei Semak came from Rubin Kazan; defenders Aleksandar Lukovic from Udinese and Bruno Alves from FC Porto. On 25 August 2010, Zenit lost its first game under Spalletti to AJ Auxerre and failed to advance to the Champions League group stage, but Zenit moved on to play in UEFA Europa League. On 3 October 2010, Zenit beat Spartak Nalchik to set another Russian Premier League record for most consecutive games going undefeated, with 21 games since the start of the league season. On 27 October 2010, Zenit suffered its first defeat of the season at the hands of rival club Spartak Moscow, seven games short of finishing the championship undefeated. On 14 November, Zenit won FC Rostov and 2 games prior to the end of the season won the championship title. This champions title became the first in Spalletti's career. Also Zenit went through to the group stage of the UEFA Europa League in first place to the 1/16 stage. In the UEFA Europa League, in the 1/16 stage Zenit beat BSC Young Boys. On 6 March 2011 Zenit won against PFC CSKA Moscow in the Russian Super Cup, it became the third Russian trophy under Spalletti, after that all domestic Russian cups Zenit won under the Italian coach. On 17 March 2011 Zenit lost in UEFA Europa League FC Twente 2–3 aggregate in 1/8 stage. In 2011–12 UEFA Champions League Zenit started in group stage drawn into group G alongside Porto, Shakhtar Donetsk and APOEL. On 6 December 2011 Zenit finished the group stage in second place and for the first time in club's history qualified for the spring knockout phase of Champions League. In the first leg against Benfica, Zenit won 3–2 at home through two goals from Roman Shirokov and one from Sergei Semak. In the second leg Zenit lost 2–0 and was eliminated from the competition. On 9 February Spalletti signed a 3.5 years contract to stay at Zenit until 2015. In April 2012, Zenit won their second straight Russian Championship after beating Dynamo Moscow.