The 28-year-old won a thrilling 200m individual medley race, coming from third going into the last lap to pip Hungarian star Laszlo Cseh to gold at the finish.
Japan’s 400m IM champion Daiya Seto, who had led going into the last turn, had to settle for bronze.
Townsend had earlier come third in the 200m freestyle race, which was won by France Olympic star Yannick Agnel, with Germany’s Paul Biedermann second.
That took Townsend overall haul to four medals, having picked up a pair of bronzes on Saturday.
In other men’s races, David Verraszto of Hungary won the 1500m freestyle ahead of Mateusz Sawrymowicz and Slovakia’s Richard Nagy, while Tony Irvin of the USA won the shortest race in that stroke ahead of George Bovell of Trinidad and Togabo and Matthew Target of Australia.
Italy’s Fabio Scozzoli took the 100m breaststroke gold ahead of Glenn Snyders of New Zealand and Henrique Barbosa of Brazil, while Tom Shields of the USA pipped Russian duo Evgeny Korotyshkin and Nikolay Skvortsov to the 100m butterfly title.
There was a gold for Russia though as Stanislav Donets won the 50m backstroke gold, beating Robert Hurley of Australia and Guilherme Guido of Brazil, while Japan’s Yuki Shirai won the 200m backstroke ahead of compatriot Hayate Matsubara. Ashley Delaney of Australia took bronze.