Harman, seeking his first major title, dropped two shots in the first four holes before birdies at the fifth, ninth, 12th and 13th took him to 12 under par, five ahead of American Cameron Young and six clear of Rahm.
The 36-year-old Harman, world number 26, showed great courage and composure after his shaky start, particularly as it happened just after Rahm had completed his round to ramp up the pressure.
"The start was tough, I hit a couple of loose shots," Harman told a news conference.
World number three Rahm conjured up eight birdies in a majestic display of ball-striking to give himself a chance to win his third major crown and second of the year.
"That's the best round I've played on a links golf course ever," Rahm told reporters.
Persons:
Brian Harman, Paul Childs, Harman, Rahm, Fleetwood, McIlroy, Jon Rahm, American Cameron Young, I've, I'm, St Andrews, Viktor Hovland, Frenchman Antoine Rozner, Sepp Straka, Jason Day, Tommy Fleetwood, Rory McIlroy, Shubhankar Sharma, England's Alex Fitzpatrick, Matt, Cameron Smith, Scottie Scheffler, Scheffler, Ed Osmond, Hugh Lawson
Organizations:
151st, Royal, REUTERS, SIX, Young, St, Thomson
Locations:
Royal Liverpool, Hoylake, Britain, U.S, England, British, American, Australia