Virginia brothers on a trip to Ireland to honor their grandfather, who recently died, saved the life of a 6-year-old girl who was swept out to sea off a Dublin beach.

The three brothers — Walter Butler, 21, and 18-year-old twins Eoghan Butler and Declan Butler — and their brother-in-law, 24-year-old Alex Thomson, were on Portmarnock Beach last Monday when they saw the young girl on a pink flamingo floaty being carried off by the ocean’s strong current.

The girl’s father screamed for help, but no lifeguards appeared, so the Butlers and Thomson darted into the water and swam toward the girl, who had drifted about a mile from shore.

It took nearly an hour for the family to rescue the girl and her father, who had desperately tried to reach his daughter and wound up needing help himself, NBC’s “Today” show reported.

“My instinct was ‘swim,'” Walter Butler, who was a rescue swimmer with the US Coast Guard from 2017 to 2018, told the news outlet.

“It was ‘get to the girl.’ By the time we started thinking, we were already swimming.”

Thomson, whose wife is pregnant, told the Irish Independent that “the main thing I was thinking about was we couldn’t lose that little girl.”

“I’m expecting a daughter in October, and was empathizing with the father’s fear,” Thomson said, adding, “I just couldn’t imagine the pain he and the family would have felt had she gone under.”

By the time the men reached the girl, she was a “nervous wreck,” Eoghan Butler told the Irish Independent.

“There’s not enough words out there to describe the exact moment, but when I saw her in the vastness of the sea struggling to keep her head above water, all I could do was to reassure her that people were out there for her and to ask for her to keep strong,” Eoghan said.

He added that he was able to calm the child down “by talking to her, asking her when [her] birthday was, what her favorite color was and other things.”

The brothers safely brought the child back to shore, where she was treated by emergency responders and eventually brought to an area hospital. Her injuries were described as non-life-threatening.

“We were in Ireland to celebrate my grandfather’s life,” Walter told the “Today” show. “It was fortunate that we could honor his life by saving a life.”

Walter noted that the date of the rescue marked 64 years since his grandfather had learned of his own brother’s drowning death, according to “Today.”

He said the rescue helped him and his family with their grief over their grandfather’s passing at the age of 84.

“This was a big moment,” Walter said.

The day after the incident, the little girl and her family went to visit the men, bringing cards and a box of chocolates to thank them.