The portrait, found at Hamburg's City Nord auction house earlier this month, was thought to have been stolen by German soldiers in 1944 during the last months of World War II.
'We welcome King John III back to Warsaw,' said Foreign Minister Radoslaw Sikorski as the painting was handed to the National Museum in the capital.
The work will undergo cleaning and be put on display next year, museum officials said.
Sikorski said Poland would continue its programme of finding and repatriating art works taken out of the country during various points in its history.
The 17th or 18th century portrait, whose creator is unknown, was one of several missing works returned in recent months to Poland by Germany.
King John III is one of the most notable figures in Polish history, and famous for his victory over Ottoman Turkey in 1683 at the Battle of Vienna.
Museum officials said the portrait was from a series of similar portraits bearing the king's likeness.
'We are happy when works that belong to us are returned after many years' absence,' said museum spokeswoman Katarzyna Wakula.