(CNN) -- Olympic champion Michael Phelps admitted it was good to be back on the winning trail after securing his first gold medal at the World Swimming Championships in Shanghai.
Defending champion Phelps, from the United States, came first in the men's 200 meters butterfly a day after he was pipped to gold in the 200m freestyle by compatriot Ryan Lochte.
He won in a time of one minute 53.34 seconds to beat Japan's Takeshi Matsuda, who had led with 50m to go, into second while China's Wu Peng claimed the bronze medal.
Phelps, a 14-time Olympic gold medal winner, has had a disappointing year but said he was relieved to pick up his first gold in China and now wanted to embark on a lengthy unbeaten run.
"A lot of it is being fitter but also I didn't want to lose that race again," he told reporters. "Having a number of defeats this year is extremely frustrating for me and I didn't like the feeling.
"So I kind of wanted to have the feeling of winning a race again. It feels good to win a race. It doesn't matter what it is so I dug as deep as I could that last 50, just tried to finish as strong as I could.
"I knew (bronze medallist) Wu Peng was finishing very well, he finished very well yesterday and Takeshi has always been there at the end. I kind of tried to put it into the biggest over-gear I could put it in and just get to the wall."
Phelps won a record-breaking haul of eight gold's at the Beijing Olympics in 2008 but had suffered a run of defeats leading into the World Championships.
Despite landing his first gold in Shanghai, and swimming quicker than last year, he says there is still more to come.
"I'm super-happy with swimming faster than I did last year, close to a second-and-a-half but I still want more in that event and I want to be faster. I think that was a little too close for my comfort," he added.
Phelps will go head-to-head with Lochte again on Thursday as they do battle in the 200m individual medley final.
Elsewhere, Federica Pellegrini, from Italy, regained her women's 200m freestyle crown and in the process made history as the first female to win both the 200m and 400m freestyle at consecutive World Championships.
The men's 50m breaststroke title went to Brazil's Felipe Franca da Silva, who pipped Italy's Fabio Scozzoli and defending champion Cameron van der Burgh of South Africa to the line.
And China took another gold as Sun Yang won the men's 800m freestyle title, beating Canada's Ryan Cochrane into second. Hungary's Gergo Kis took bronze.