Hertha Berlin forward Matheus Cunha scored the game’s only goal in the first half to maintain Brazil’s charge for the gold medal.
– Men’s Olympics soccer bracket and fixtures
Egypt had been the surprise package in the men’s draw having qualified ahead of Argentina, despite only winning their final match.
Brazil started with big-hitters Dani Alves and Richarlison but struggled to find the opening goal and Egypt created chances of their own.
Cunha got the game’s only goal on 37 as he finished off from inside the box following an assist from Richarlison.
Brazil continued to press, but were unable to add a second and Emam Ashour had a late shot blocked as Egypt pushed for an equaliser.
Mexico await Brazil in the semfinals in a repeat of the 2012 Olympic final, which El Tri won.