Lyles, the Olympic 100m champion who is also a three-time defending world 200m champion, was made to work in his semi-final before finally coming through to win in 9.92 seconds.
Nigeria's Kayinsola Ajayi was a surprise second, just 0.01 seconds adrift, with South Africa's nearly man Akani Simbine in third (9.96 seconds) and also going through.
With just the top two from each of the three heats plus the next two fastest qualifying, 2021 Olympic champion Marcell Jacobs of Italy made his exit with a sixth-placed finish.
The second heat was a 9.85-second photo finish between Thompson and American Kenny Bednarek.
Jamaican Oblique Seville wrapped up the third and final semi in 9.86 seconds ahead of Tebogo (9.94 seconds).
Third-placed South African Gift Leotlela ensured he also advanced to the eight-man final as the second of the next fastest finishers in 9.97 seconds.