Poland captain Robert Lewandowski opened the scoring with a header in the 32nd minute, but Irvin Cardona equalized four minutes later after an error by the visitors' defence.
Paweł Wszołek restored Poland's lead, but Teddy Teuma pulled Malta level from the penalty spot nine minutes later.
Piotr Zieliński sealed the 3-2 win for Poland in the 85th minute with a long-range strike.
Poland wrapped up their qualifying campaign with a narrow victory despite entering the match ranked No. 33 by football's global governing body FIFA, while Malta sit at No. 166.
The Poles, coached by Jan Urban and captained by Lewandowski, drew 1-1 with the Netherlands in their penultimate qualifier in Warsaw on Friday.
Poland coach Jan Urban. Photo: PAP/Leszek Szymański
After eight rounds of fixtures, Poland finished second in their qualifying Group G with 14 points, three behind the Netherlands, who qualified directly.
All group winners in European qualification earn automatic berths at the World Cup. The 12 runners-up will have a second chance to advance through playoffs in March.
The playoff draw will be held at FIFA headquarters in Zürich, Switzerland on November 20.
The tournament will be held from June 11 to July 19, 2026 in the United States, Canada and Mexico, featuring 48 teams—16 more than in Qatar in 2022.
Poland reached the round of 16 at the 2022 World Cup in Qatar before being eliminated by eventual runners-up France.
In 2018, the Polish team suffered an early exit from the global tournament in Russia.
Source: TVP Sport, IAR, PAP