Spain 3 Egypt 0
New Zealand 4 South Africa 1
Spain booked their spot in the men's hockey semi-finals at the Athens Olympics on Monday but Egypt made them work for their 3-0 win.
Spain are seen as a medal favourite despite a world ranking of nine and now meet either defending champions the Netherlands or Australia, who have won medals at the last three Olympics.
Spain put pressure on bottom-ranked Egypt from the start but only Eduardo Tubau managed to score in the first half. In the second, Pol Amat won a penalty strike and Tubau netted a penalty corner for a comfortable if not stellar win.
"We're going to forget that match but we did what we had to do," said Spain's coach Maurits Henrdiks, who trained the Dutch to gold at Sydney 2000.
"The team is at its best and can beat anyone, I'm convinced of that. We're not scared of anyone. We've come to win a medal."
Egypt defended desperately to save face after losing their last match 11-0 against South Korea. The Koreans play Germany later for the last semi-final slot.
Earlier, New Zealand beat South Africa 4-1 to finish third in Pool B. They now go into the playoffs to decide places 5-12.
The Kiwis made the most of a clinical second half in which it scored thrice without reply.
New Zealand needed a win to guarantee third place in Pool B behind semifinalists the Netherlands and Australia.
It started well for New Zealand after 15 minutes when Dave Kosoof made the most of a loose ball in the South Africa circle and hooked it home despite lying on the ground for his first goal of the tournament.
South Africa fought back and in the 28th minute equalised after an attack down the right led to Emile Smith taking advantage of an uncertain clearance by goalkeeper Paul Woolford to score with a nice hit.
At the start of the second half, South Africa threatened when they received a penalty-corner. Woolford made up for his earlier uncertainty with a confident save and just a minute later New Zealand forced a penalty-corner.
Penalty-corner specialist Hayden Shaw scored his fifth goal of the tournament from a set piece with a powerful but controlled flick into the bottom corner of the South Africa goal. It made Shaw the tournament's most successful penalty corner exponent, moving ahead of Korea's Lee Jung Seon and Pakistan's Sohail Abbas.
In a worrying moment for New Zealand, their captain Simon Towns appeared to twist his left knee in an otherwise innocuous challenge and had to leave the field for treatment. He later returned, but quickly left again without reappearing.
Without him, New Zealand were still able to take opportunities and benefited once again from Shaw's prowess at penalty-corners in the 45th minute to move 3-1 ahead. It was a carbon copy of his first and took his tournament tally to six, just one behind the overall top goalscorer, Lew of South Akorea with seven.
South Africa still had its chances to get back into the match, but despite a host of penalty-corners couldn't find a way past Woolford, who guarded his goal with skilful authority.
New Zealand's ability to make the most of its chances was the main difference between the sides and Phillip Burrows finished the match off in style, running freely into the South Africa circle with just seconds to go before unleashing a bullet drive across the goalkeeper and into the top corner of the net to make the final score 4-1.
Despite winning three matches in the Pool phase, New Zealand did not qualified for the semifinals and will now contest the fifth to eighth classification matches. Their opponent is yet to be decided for the match that will take place on Wednesday.
South Africa finished the Pool with just one win over Argentina, and will contest the ninth to 12th classification matches, also on Wednesday.