BOSTON (AP) — The Massachusetts State Lottery has raked in $997 million in profits for cities and towns during the 2018 fiscal year — the second-highest in the lottery's 47-year history but a dip from the more than $1 billion pulled in during the prior fiscal year.

Lottery revenues came in at a record high of $5.29 billion, surpassing the previous record set in the 2016 fiscal year by $58 million and beating last year's revenues by $194 million.

One reason why revenues were up but net profits slipped was the record $3.89 billion in prizes paid out to lottery winners. Payouts can fluctuate from year to year based on the schedule or rate at which players cash in their prizes.

The Lottery's administrative costs account for about 1.9 percent of overall revenues.