Hayes was selected to represent Great Britain at the 2012 Summer Olympics in the men's triathlon alongside brothers Alistair and Jonathan Brownlee. Hayes, who was ranked 46th in the world at the time of his selection, was chosen ahead of world number 12, Will Clarke, and world number 13, Tim Don, because of his ability to perform a domestique role for the Brownlees. The event took place in Hyde Park with the swim being held in the Serpentine. The cycle involved athletes leaving the park via Queen Mother's Gate, travelling through Wellington Arch, down Constitution Hill and on to Birdcage Walk in front of Buckingham Palace before returning to the park to complete the event with a four lap run around the Serpentine. Hayes finished in 37th place, however his job in this race was to help the two Brownlee brothers, a job he succeeded in as Alistair finished in gold medal position and Jonny in bronze.