Argentina topped the standings on six points while Poland were awaiting the outcome of the other group game between Saudi Arabia and Mexico to see if they would come second and also qualify despite the loss.
Midfielder Alexis MacAllister put Argentina ahead straight after the break with a low first-time shot after a flowing passing move, while Julian Alvarez shot past Poland goalkeeper Wojciech Szczesny in the 67th minute to make it 2-0.
In the first half, Szczesny was Poland’s hero as he made a diving stretch save to deny Messi a penalty, awarded after his outstretched hand made contact with the Argentine striker’s face.
Poland: Wojciech Szczesny, Kamil Glik, Jakub Kiwior, Matty Cash, Bartosz Bereszynski, Grzegorz Krychowiak, Piotr Zielinski, Krystian Bielik, Przemyslaw Frankowski, Karol Swiderski, Robert Lewandowski (c).
Argentina: Emiliano Martinez, Cristian Romero, Nicolas Otamendi, Nahuel Molina, Rodrigo De Paul, Marcos Acuna, Alexis Mac Allister, Enzo Fernandez, Angel Di Maria, Julian Alvarez, Lionel Messi (c). (Reporting by Andrew Cawthorne and Anita Kobylinska; Editing by Angus MacSwan)