This 87-year-old man broke his hip and wasn't able to buy Mega Millions tickets. After joining the hospital pool, he won.

A New Jersey man’s injured hip turned out to be his lucky break after he ended up winning the lottery.

Earl Livingston, 87, was walking to buy a ticket for the Mega Millions jackpot when he fell and broke his hip, WCAU-TV reports.

Livingston had to be hospitalized at Jefferson Stafford Hospital and missed out on buying an entry. However, the man’s niece, Bobbie Mickle, told hospital staff about him wanting to enter so they invited him to join their pool with 141 other entrants.

The pool won $1 million.

Mickle told NBC 10 she didn’t believe her uncle when he told her he’d won from his hospital bed. “I thought he was confused, maybe from pain meds,” she said. “And then the staff came into the room and they were saying congratulations and I was like, ‘Wow, he really did win’.”

Livingston will have to wait before he can celebrate his win though. Unfortunately, the break means he’ll need a hip replacement.

“I want to thank everybody,” Livingston said. “I appreciate very much and God bless you and have a happy, happy long life!”

Read more from Yahoo Lifestyle:

Follow us on Instagram, Facebook, and Twitter for nonstop inspiration delivered fresh to your feed, every day.