The Rileys, with James and his sisters Mary and Katharine, moved to the United States when James was aged 10.
In February 2003, when Riley was 31 and serving as an army sergeant in Fort Bliss Texas, he got the call-up to go to Iraq as a machinist.
Less than a month later, his 507th Maintenance Company was travelling in a convoy of Humvees in southern Iraq when they took a wrong turn. The date was March 23, 2003 - 10 years ago this weekend.
Riley said the company was greeted by a hail of bullets from swarms of Iraqis on the outskirts of the unsecured city of Nasiriyah. "It wasn't a small ambush. It was a whole city. And we were getting shot from all different directions as we were going down the road," he later told the Washington Post. The soldiers returned fire, but desert sand jammed their rifles. As the highest-ranking soldier, it was Riley's decision to surrender.
"We were like Custer," he said. "We were surrounded. We had no working weapons. We couldn't even make a bayonet charge. We would have been mowed down. We didn't have a choice." Nine soldiers were killed.
Journalist Jose Martinez co-wrote a book about the capture, spending more than a year interviewing one of the prisoners, 21-year-old Specialist Edgar Hernandez. Bullets were flying everywhere and Hernandez was hit in the face by shrapnel.
"We started panicking ... then Riley opened Johnson's door and said, 'Get out! Get out!' I could hear the bullets fly by my head. I tried to quickly get underneath my truck. I panicked when I saw blood coming down my face and I told Riley I got shot in the head."
Riley, in a prone position, barked: "No, no, no, stay down, it's shrapnel."
Hernandez screamed, "I'm going to die", but Riley calmed him down.
As the hail of bullets continued, Riley stepped out and laid down his weapon. Hernandez said an Iraqi ripped Riley's glasses from his face and started to punch him repeatedly.
Hernandez, Riley and three other soldiers - Private First Class Patrick Miller, 23, Spc Joseph Hudson, 23, and Spc Shoshana Johnson, 30 - were bound, blindfolded and taken as prisoners of war.
Another Humvee, in which 19-year-old Private First Class Jessica Lynch was travelling, crashed in the ambush. Four other soldiers in that vehicle were killed, and Lynch was seriously injured.
As word crept out in the international media of the hostage-taking, Lynch became the poster girl for the hostages and the Pentagon held her up as a heroine who went down shooting.
As Lynch later revealed to a Congressional hearing, Pentagon reports of her heroism were spin. In fact, she was injured in the crash and lost consciousness. Days later, she woke up in Nasiriyah hospital with no idea how she had got there.
Still bound and blindfolded, the surviving members of Riley's company were taken to Baghdad. There, they were placed in separate cells with metal doors.
Iraqi soldiers filmed the prisoners and their images were broadcast around the world. Riley's parents found out their son was a prisoner of war when his mother's co-worker saw his frightened face on the internet.
The wounded were treated: Johnson had been shot through both ankles with a single bullet, Hudson had been shot in the buttocks and side, and Hernandez in the right arm.
They were given wool blankets and fed chicken and rice. The following day they were joined by two more US soldiers, whose Apache chopper had been shot down in central Iraq. Chief warrant officers David Williams, 31, and Ronald Young jnr, 26, had dived into a canal and swam about half a kilometre before being captured.
Martinez said the soldiers were beaten and paraded as war trophies to an angry Iraqi mob. They were kicked and peed on, he says, and moved around from prisons to government offices to private homes. They were moved in a Red Cross ambulance so American forces could not find them.
Speaking to the Herald on Sunday this week, Shoshana Johnson says Riley was quiet while in captivity. "He was always asking if I was being taken care of," she recalls. "I had been shot in both legs and I was beaten. They didn't realise I was a woman in the beginning but when they found out I was a woman they did ease up on me."
Finally the seven soldiers were taken to one last prison, a private house in the northern town of Samarra. They were close to Tikrit, the hometown and stronghold of Saddam Hussein. As it became clear the war was over and US Task Force Tripoli pushed up towards Tikrit, the officers holding them fled. The remaining, confused Iraqi guards stayed and treated them well. Marines sent to secure the Baghdad-Tikrit highway met an Iraqi soldier along the way, who told them where to find the missing soldiers.
After three weeks of fear and uncertainty, Johnson describes the April 13 rescue as something from a movie. "The Marines kicked in the door and we knew we were going home," she says. "It was unreal."
Within hours, the seven were on their way to Kuwait and then the US.
Johnson, now 40, has stayed close to Riley and says he has often questioned his decision to surrender - but she knows he did the right thing.
"I know he wouldn't have done that if he was on his own, but he was responsible for the rest of us. So he did what he thought was the right thing to do. My father, who is a 20-year military man, sat down with him when we came back and told him 100 per cent he had done the right thing. He was grateful to him for that decision."
Johnson still has bad scars from her gunshot wounds, and her legs still ache from nerve damage and arthritis. "If they ache it's okay because I am grateful that they are still there. I'm so happy that I did not lose my legs because so many others were not so fortunate."
She suffers post-traumatic stress disorder, too. "I have periods of deep depression and anxiety, and suffer from flashbacks. But I think I'm doing well compared to lots of others."
Her daughter, Janelle, was two years old when 507th Maintenance Company was ambushed. Now she is 12.
"I thought about her a lot when I was being held in Iraq," Johnson says. "I knew she was being cared for by my family but I wanted to be the one to see her hit puberty and go to college and go on with her life, and I am blessed to be able to do that."
Jessica Lynch remembers little about her ordeal. She was a supply clerk in the company and was only 19 years old.
"I was patrolling with the others until I got separated," she tells the Herald on Sunday in an exclusive interview. While the others were taken to Baghdad, she was kept in Nasiriyah. "I was held in hospital because my injuries were so severe."
She had a broken back and internal injuries, including bowel, bladder and kidney damage. She was rescued from hospital by US commandos, reportedly after a tip from an Iraqi lawyer.
Today, the 29 year-old has a 6-year-old daughter, Dakota Ann - named after her best friend Lori Ann Piestewa, who was killed during the ambush.
Lynch lives with her husband, Wes Robinson, in West Virginia and has qualified to be a preschool teacher with the help of a scholarship. "I'm doing great; I am a substitute teacher. Teaching is great - I love it," she says.
"The past 10 years has flown by but it also feels like a long time ago," she says. "I have my up and down days. Like everyone, I am dealing with it. I have a great support system. That really helps."
James Riley remains unmarried and lives in Virginia near the training base at Aberdeen. Since his return from Iraq, he has been using his experience to teach young soldiers. He retired as a commissioned soldier two years ago, but is still contracted to the army as a civilian instructor.
"He seems as normal as he was before," says his mother, Jane. "It was a hard time then, but we were lucky. We got our son back."
But Riley returned to sad news: the family was grieving the loss of his sister Mary, who died at 29 of a rare brain disorder. "She died five days after James was captured," Jane says.
After Riley's rescue, his father Athol, had to tell him his sister had died.
"He was lucky he didn't have to go back," Jane says. "Once you have been a prisoner of war you are not allowed back to the same area. Other soldiers have done so many tours and have had to go back time and time again. It is terrible to think of the damage that is happening to some people."
Jane and Athol recently visited New Zealand for the funeral of Athol's mother Patricia, in Howick.
Riley's students are the only people he opens up to about his experiences, says former comrade Shoshana Johnson. "I worried about him in the beginning because he didn't talk and I would check up on him, but I think the fact he teaches and passes on his knowledge to other soldiers is therapeutic for him. It means there is a purpose for what he went through.
"He found his way - that's the struggle each one of us had, was to find a way."
That's what Riley's friends, family and army comrades say - but what about him? He says his company was not designated as a combat unit and he never believed he would be taken as a prisoner of war. "That'll never happen to me, that's what I said," he says in an interview for the Aberdeen army base newsletter.
"I have the opportunity to pass on things that I've learned, some the hard way, some in different schools, all over. You gotta take a bit from here and there and piece it all together so that it works for you and your given situation."
Riley says what he is most proud of is not how he handled himself in the ambush, surrender and three weeks of captivity, but his work as an instructor. "I'm just an individual doing my job. This can be a real tough job and, like a lot of things, it's all what you make of it.
"I'm just trying to pass on all that I can so that they cannot make the same mistakes and face the consequences.
"Even if it wasn't your fault, you're still gonna live with that."