Cielo qualified first in the 50-meter butterfly Sunday morning with a time of 23.26 seconds.

Swimming governing body FINA had challenged a Brazilian federation decision to giv Cielo only a warning after he tested positive for a banned substance at a meet in May. The court ruled on Thursday that he could compete in Shanghai.

Cielo said the past month has been very emotional for him but he’s already put the controversy behind him.