Two measles outbreaks in Kansas City have ended, but officials have just started to calculate the costs of containing them.

The city deemed the outbreaks officially over as of Monday, when there had been no new cases in 42 days, or two full incubation periods, the Kansas City Star reported . The city had been combating the highly contagious virus since March.

"Part of our challenge was many, many exposure sites," said Mary Anne Jackson of Children's Mercy Hospital. "This included our day care center, this included a megachurch ... this included multiple health care settings including Children's Mercy and pediatricians' offices in multiple different counties. So you can see how difficult it is to halt the spread of measles once it gets within your community."

More than $170,000 in taxpayer resources went to holding the outbreaks to 35 total cases, 22 of which were in Kansas and the rest in Missouri.

The Kansas Department of Health and Environment said it spent about $46,000 on lab testing, vaccines and staffing costs. That estimate doesn't include costs to maintain the state's disease surveillance software or salaries for support staff.

The Missouri Department of Health and Senior Services can't provide a cost estimate because much of it was wrapped into the state's ongoing disease surveillance.

"We'd have a hard time putting together actual numbers," said Kerri Tesreau, director of the department's Division of Community and Public Health.

Missouri's Clay County didn't have any actual cases among its residents, but the outbreak still cost its Public Health Center about $6,000 because epidemiologists spent time coordinating with both states and other local health departments, said county spokeswoman Kaitlyn Wallace.

The county hoped to use the outbreaks "to emphasize the importance of vaccination and to learn to be even more prepared in the future," she said.

More From AM 1050 KSIS