By Alan Baldwin

RIO DE JANEIRO (Reuters) - South African Chad Le Clos has vowed to do all he can to take the fight to Michael Phelps one last time before the U.S. swimming great heads into retirement.

"I've got a clear head, I will respond," he told reporters after qualifying for the Olympic 100 meters butterfly semifinals.

"I've always said don't judge me when I'm running like a lion, judge me when my back's against the wall."

Phelps and Le Clos clashed last Tuesday in the men's 200m butterfly final, an event that Phelps lost to the South African in a stinging defeat in London four years ago but won back in style in Rio.

The American now has 21 Olympic gold medals and 25 in total.

Phelps has won the 100m butterfly for the last three Games, beating Le Clos to silver in 2012, but the South African has extra motivation this time.

"I need one more gold medal to become the best African athlete in the Olympics," he said. "I've got a gold and two silvers. I need one more gold to pass everyone else."

Casting his mind back to the 200m butterfly final, where he finished fourth, Le Clos said he was baffled by what happened.

"In my mind I was winning. With 10 meters to go I was winning. It was just like my body wasn't going and it was, like, what's going on here? It was the first time in my life it's ever been like that," he said.

"To lose in a 54.0 (1.54.06) is disgraceful from my side. I'm not the kind of guy that accepts defeat like this."

Friday's final could be the last individual race for the most successful Olympic athlete of all time, and the last duel with Le Clos providing both qualify.

Le Clos said he hoped Phelps, 31, might have a rethink, just as he did after retiring four years ago.

"If he can hang on for another year I would appreciate it so much," he said. "I'd love to race him again somewhere along the line in the 200 fly.

"He is the greatest of all time...he has always been in many ways my idol," continued Le Clos.

"But look, he's still in good shape. I'm sure he can continue."

The swimming world championships will be held next year in Budapest but Phelps has indicated clearly that Rio really is going to be his swansong.

"This is it. I’m swimming how I want to and this is a great way to finish," he told NBC.

(Reporting by Alan Baldwin; Editing by Andrew Hay)