This year’s Boston Marathon not only brought 30,000 runners through the region’s streets, but it also generated $509 million in state and local economic activity, according to a study released Thursday.

“You can count on the Boston Marathon. The businesses can count on the Boston Marathon to be that rite of spring. ... It’s a huge sense of pride for local businesses, local residents, local runners, sports enthusiasts, and I think that’s only on the increase,” said Boston Athletic Association President and CEO Jack Fleming during a Thursday morning press conference at BAA headquarters.

Prior studies measured the economic impact of runners’ participation. This year, for the first time, the study also included spectators. The total of $509 million in 2024 represents operating costs for the BAA, spending by marathon participants and spectators, taxes, vendor spending and more during the full weekend, not just marathon Monday.

Spectators accounted for $208 million and runners made up $42 million in spending across areas such as hotels, restaurants, shopping and entertainment during marathon weekend.

About 60% of spectators were from out of state and 87% of runners were from out of state, with the majority staying overnight in the city or in nearby Greater Boston.

The study was commissioned by Meet Boston and conducted by the Economic and Public Policy Research group at the University of Massachusetts Donahue Institute.

Martha Sheridan, president and CEO of Meet Boston, said the marathon also serves as an introduction to the city for many visitors with hopes they will come back in the future.

“That’s where that economic trickle down really happens, not just during the five days of the event,” Sheridan said.