Hungary beat Andorra 2-0 to take the third place in its World Cup qualifier group at the Puskas Stadium.
Hungary failed to qualify for the finals in Brazil in 2014 despite the win Tuesday, because Romania took second place by beating Estonia 2-0, reports Xinhua.
Hungary's coach Sandor Egervari quit Friday after his team lost to the Netherlands 1-8 and under temporary head coach Jozsef Csabi the Hungarians worked hard to break the Andorran defence.
After a scoreless first half, Hungary scored two goals, one in the 52nd minute by Nemanja Nikolics, a Serbian recruit who has been a Hungarian citizen since 2011, and the second, which was in the 77th minute, an own-goal by Andorra's Ildefonso Lima.