Media playback is not supported on this device
The 21-year-old was fifth with 250 metres remaining before powering through to win a time of three minutes 31.447 seconds.
The Czech Republic's Josef Dostal took silver in 3:32.145, and Russia's Roman Anoshkin won bronze in 3:33.363.
Walz has an English father and a German mother, but grew up in Majorca, Spain.
Find out how to get into canoeing with our special guide.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.
Oxford-born Spaniard Marcus Walz produced a remarkable finish to take the Olympic kayak 1,000m title at the Lagoa Stadium.