Ryan Lochte stormed into the final of the men's 400 metres individual medley as top qualifier at the world swimming championships on the last day of competition on Sunday.

Lochte, bidding to win his fourth individual gold medal and fifth overall in Shanghai, clocked four minutes 11.89 seconds, almost two seconds faster than Japan's Yuya Horihata.

"(That) hurt," Lochte said. "(The) 4IM is never an easy event. It's one of the hardest events out there.

"I did what I had to do. I want to be in the middle of the pool and that's what I did this morning."

Lochte said he was unsure if the United States coaches would include him in the team for the 4x100 medley relay final and give him an opportunity for a sixth gold medal in Shanghai.

"I don't know if I am on the relay. The coach is going to put the best guys (in). Whoever they choose they choose (and) it is what it is.

"I gotta worry about my 4IM."

No matter the decision on the relay, the 26-year-old American's chances of retaining the individual medley title he won in Rome in 2009 were improved markedly when Hungary's Lazslo Cseh inexplicably failed to qualify for the final.

Cseh, the bronze medallist in the 200 IM in Shanghai, fell behind at every turn and faded badly in the final freestyle leg of the third heat, finishing in 4:22.26 and 22nd overall.

Cseh had been considered one of the main challengers to Lochte, having won a medal in individual medley races in each of the four previous world championships and at the Beijing Olympics in 2008.

Beijing Olympic champion Stephanie Rice advanced to the final of the women's 400 IM, qualifying in fifth place overall. Elizabeth Beisel of the United States was the fastest qualifier while China's 200 IM gold medallist Ye Shiwen just snuck into the final in eighth place.

"Happy that I got in," Rice said. "I just did enough to get myself in there.

"You don't want to do a final swim in the morning for a 400."

The U.S. qualified fastest for the 4x100 medley relay, ahead of Germany and the Netherlands.