Christopher Samba's first goal for Anzhi since joining from Blackburn Rovers helped his new club to a 3-1 win over Rubin Kazan in the Russian Premier League on Sunday and secure a berth in the Europa League next season.
The French defender headed home a 60th-minute goal from a corner to make amends for a thin-air swing that allowed Sergei Davydov to open the scoring for the hosts after just 40 seconds.
Mbark Boussoufa had leveled it 13 minutes later for the hosts, burying the ball in the corner after a through pass from Samuel Eto'o. Rubin defender Salvatore Bochetti had gifted the Cameroonian the ball for the setup.
Eto'o made sure of the win a minute from time, cutting in from the right to fire into the far corner.
Anzhi remain fifth but move to 70 points, four clear of sixth-placed Lokomotiv Moscow, who could only draw 2-2 at Dynamo eariler Saturday. Anzhi host champions Zenit in the final game of the season next Sunday.
It guarantees Anzhi a place in next year's Europa League, a remarkable turnaround for the former minnows from Dagestan, the millions of tycoon owner Suleimov Kerimov notwithstanding.
Kerimov bought the club in January 2010 with the goal of transforming a modest provincial side into a major European force. He raised eyebrows by persuading established stars Roberto Carlos and Eto'o to play in Russia, and rounded it off this season with the winter appointment of Guus Hiddink as manager.
Anzhi have not proven unbeatable under Hiddink, in fact the Rubin victory was just his fifth in 12 games, but they were enough to push the team into European competition and satisfy Kerimov's initial requirements.
Rubin's winless run extends to six matches, with only one victory in their last 11 games.
Rubin rode their luck on several occasions in the first half and were lucky to go in at the break with the scores level.
Boussoufa was denied by Rubin's Lithuanian goalkeeper Giedrius Arlauskis after the Moroccan went clean through on goal.
Anzhi's Odil Ahmedov hit the crossbar with the goal at his mercy, before heading wide in front of an empty goal from five yards out moments later.
Anzhi maintained the pressure in the second half.
Eto'o raced clear on 75 minutes and attempted a chip that floated just over Arlauskis' goal.
The players were wearing black armbands in memory of the victims of this week's double car bombing in the Dagestani capital that killed 13 people and wounded 100 more.