By Mark Trevelyan

RIO DE JANEIRO (Reuters) - Maya DiRado of the United States won the women's 200 meters backstroke in her final race before quitting swimming on Friday, coming from behind to deny Katinka Hosszu a fourth gold medal at the Rio Olympics.

The American reeled in the 'Iron Lady' from Hungary in the last 50 meters, the pair swimming neck and neck in adjacent lanes before DiRado touched first to win by six-hundredths of a second.

Canada's Hilary Caldwell won bronze.

For DiRado, who is leaving the sport to take up a job in management consultancy, it was the perfect way to exit after a week in which she has now won two gold medals, one silver and one bronze.

"It's indescribable. That is just pure joy and surprise and excitement," she said. "That was my last race ever and I just won a gold medal."

She spent part of the day emailing her new employers to take care of the formalities before starting work on Sept. 9, but far from being a distraction it served to help her.

"I read through, like, how to do expense reports, which was nice to kind of take my mind off the final tonight."

Hosszu blamed her loss on a poor final touch but said she was pleased with her week's work, having won three golds after leaving with no medals at all from three previous Olympics.

"I haven't been on the podium before, and I was able to be on the podium four times and three times on top, so I don't think I could have done any better," she said.

Hosszu had led from the start, reacting fastest from the block, but DiRado shadowed her the whole way, drawing level in the last 25 meters and then touching first in two minutes, 5.99 seconds.

Turning to look at the scoreboard and see the number one against her name, her eyes widened and she clapped her hand to her mouth as if she could not believe the result.

Hosszu had already won the 100 backstroke and the 200 and 400 individual medleys in Rio, breaking the world record in the latter. DiRado added to her gold in the 4x200 freestyle relay, silver in the 400 individual medley and bronze in the 200 IM.

(Editing by Greg Stutchbury and Peter Rutherford)