A Michigan man thought he made a costly mistake by accidentally buying two identical $2 lottery tickets, but it turned out he hit the $1 million jackpot twice. 

Samir Mazahem, 56, said he was saving lottery numbers online for the June 9 Mega Millions game when he realized he accidentally bought two of the same tickets. 

“I went online and bought a ticket using numbers that are family birthdays. I forgot to save the numbers as favorites in the app, so I went back in and set them up as favorites so I could easily play them in the future," Mazahem said

MAN BUYS $200G LOTTERY TICKET AFTER BUYING MAC AND CHEESE FOR DINNER

“What I didn’t realize, is that meant I would be buying a second ticket with the same numbers. Once I figured out I had bought two tickets with identical numbers, I was a little bummed but didn’t think much about it."

Any regret he had about the wasted $2 instantly went away when he recently logged in and realized he won on both tickets. 

BOISE GROCERY SHOPPERS GET $5,000 FREE GROCERIES FROM SUPERMARKET GOOD SAMARITAN

"I recently logged into the app to check on some tickets I had bought, and that is when I saw I had two $1 million prizes pending," Mazahem said. "Saying that I was stunned is an understatement. I couldn’t believe it was real. It took several days for the reality to set in that my mistake had paid off to the tune of $2 million!"

The Dearborn Heights man said he plans to buy a house with his winnings then save the rest for retirement. 

CLICK HERE TO GET THE FOX NEWS APP

The coronavirus pandemic has had a mixed effect on state lotteries.

Some states, like Texas and Montana, have seen a boost in lottery sales since March, owing to citizens shelling out more cash than usual for scratch-offs. Other states, like Virginia and Oregon, have seen revenues fall due to lockdowns closing bars and retail stores in which tickets are sold. 

The Associated Press contributed to this report.