India finished on top of their pool despite losing 2-3 to Olympic champions Germany in their last preliminary league match in the Champions Trophy hockey tournament in Melbourne on Tuesday.
India squandered the lead twice to handover the match to the Germans, but still topped Pool A on superior goal difference.
Both India and Germany finished with six points each, but India's two previous victories by two-goal margins ensured them the top spot.
India finished with a goal difference of plus-three (+3), while Germany's goal difference was minus-one (-1).
The top-spot finish gave India a quarter-final date against Belgium, who finished at the bottom of Pool B with three successive losses, including Tuesday's 4-5 defeat to Olympic silver medallists the Netherlands.
Germany will take on Asian Games champions Pakistan, who were beaten 0-1 by defending champions and hosts Australia in the last preliminary league fixture.
Australia needed to post a two-goal victory over Pakistan to finish on top in their group ahead of the Netherlands, but just scored once through Kieren Govers.
Both the Netherlands and Australia finished with seven points from three games, but the Dutch side took the top position in Pool B on the basis of a one-goal advantage over the hosts.
The Dutch will now face Pool A's bottom place finisher New Zealand in the quarters, while Australia meet England.
England finished third with four points after being held to a 1-1 draw by New Zealand for whom this was their only point in three outings.
Against Germany, India drew first blood in the sixth minute when Gurwinder Singh Chandi picked a through ball from Rupinder Pal Singh on top of the 'D' and sent a rasping shot into the net past German custodian Nicolas Jacobi.
Germany equalised in the 14th minute through Oliver Korn, who capitalised on a shaky Indian defence on his second attempt after the first shy ricocheted off the right post.
India went ahead again in the 46th minute as Nitin Thimmiah deflected in Birendra Lakra's shot into the net following their first penalty-corner.
Lakra fired a rebound after V R Raghunath's drag-flick was blocked by the German goalkeeper.
India dominated the second half for long periods, but their strikers failed to breach the German defence.
India's advantage was negated by two goals in as many minutes from Tobias Matania.
Matania first capitalised on a long through pass in the 56th minute and then converted Germany's second penalty-corner with a firm shot a minute later to put the Olympic champions in the lead for the first time in the contest.
India's efforts to bounce back came a cropper as Germany slowed down the game and packed their defence to keep the desperate rival attackers at bay.
After England were held to a draw by New Zealand, India were virtually assured of the top spot in their group unless they suffered a very heavy defeat.
But seeking to keep the winning momentum going, India brought in captain Sardar Singh and Manpreet Singh, both of whom are not in peak fitness.
Manpreet had 10 stitches on the right cheek after being struck by a New Zealand player's stick, while Sardar had a stiff shoulder after a nasty fall in the last game. Striker S V Sunil, who is suffering from hamstring pull, was not included in the line-up today in a bid to help him recuperate ahead of the quarter-finals.
With the No 1 position in their group assured, India fielded reserve goalkeeper Sushant Tirkey for the last 10 minutes of the match as they went all out in search of the equaliser.
India forced their second penalty-corner in the 65th minute, but Raghunath's rising drag-flick struck an onrushing defender's body and was ruled for dangerous play.
With two minutes remaining, India were awarded another penalty-corner when Sardar was obstructed inside the circle, but a bully was ordered after a review.
Photograph: Michael Dodge/Getty Images