A college class ring lost in the surf at a Massachusetts beach nearly half a century ago is back on the finger of its Long Island owner.

Patrick O’Hagan, 70, of Holtsville, lost his Class of 1969 Manhattan College ring while on his honeymoon in Dennis, Massachusetts in 1970. The O’Hagans had waited nearly 50 years to see the ring again.

James Wirth was in ankle-deep water at low tide on a Dennis beach last month scanning with his metal detector when he found the corroded ring.

“I knew it had been there a long time,” he said.

Tracking down the owner was easy, because O’Hagan’s full name was inscribed on the ring, along with an “E” indicating he had studied engineering. It also helped that O’Hagan’s wife, Christine Kehl O’Hagan, 67, had published a memoir in 2005, in which she mentioned her husband and his days at Manhattan College.

“I knew this was the guy I was looking for,” said Wirth, 50, who lives in Marin County, California, and spends eight weeks each summer in Cape Cod.

Wirth then found the couple’s contact information online and reached them at the end of July, when Christine answered the phone.

advertisement | advertise on newsday

“We kept seeing ‘James Wirth, James Wirth,’ the name kept coming up” on caller ID, Christine O’Hagan said.

Christine O’Hagan said they were “thrilled” to hear he found the ring.

Years ago, she worked as a telephone operator and saved money each week to buy Patrick the ring — heavy gold with a large green stone — as a graduation present, she said. It cost her $100 at the time.

He loved it so much, he wore it on their wedding day and on their honeymoon trip to the beach, where it got lost in the surf, she said.

Christine O’Hagan always hoped they’d find the ring.

“Every time I got down to the shore, I looked at the shoreline,” she said. “I always said, I know the Atlantic is big, but you never know.”

Wirth cleaned the ring and mailed it back to the couple.

Through his metal-detecting hobby, he’s found dozens of rings and isn’t always able to send them back to their owners, Wirth said. This one was an easy puzzle, with all the clues right on the ring.

“To be able to return a ring like that to someone, who lost it 47 years ago, that’s going to make a world of difference to him,” he said. “I was thrilled to bring this ray of sunshine.”

— With AP