Kenneth McGrath of Raleigh had luck on his side when he won a $512,114 Cash 5 jackpot.

McGrath beat odds of 1 in 749,398 to match all five numbers in Saturday’s drawing.

He claimed his prize Friday at lottery headquarters in Raleigh. After required state and federal tax withholdings, he took home $355,925.

McGrath said he used the numbers that came into his head when he decided to get a $1 Cash 5 ticket. He bought the ticket at the Kangaroo Express on Creedmoor Road in Raleigh.

Ticket sales from games like Cash 5 made it possible for the lottery to raise more than $634 million for the state last year. For details on how lottery funds have made a difference in Wake County, click on the “For Education” section of the lottery’s website.