Benfica are through to the last eight of the Champions League after striker Darwin Nunez headed home a 77th-minute winner for the Portuguese club.
The European giants were level with Ajax after the first leg, which ended 2-2 in Portugal.
While Ajax were the favorites at home, Benfica withstood a lot of pressure from the Dutch side, and got a valuable goal on the break.
Ajax will be bitterly disappointed to exit the competition, after they had won all their group stage games to qualify for the last 16.
Manager Erik ten Hag will face more questions about his future, after links to managerial jobs at Manchester United and Paris Saint-Germain.