New York (CNN) Targeted ransomware attacks on local US government entities -- cities, police stations and schools -- are on the rise, costing localities millions as some pay off the perpetrators in an effort to untangle themselves and restore vital systems. The tally by cybersecurity firm Recorded Future -- one of the first efforts to measure the breadth of the assaults -- found that at least 170 county, city or state government systems have been attacked since 2013, including at least 45 police and sheriff's offices. There have been 22 known public-sector attacks so far in 2019, which would outpace 2018, and that does not take into account that attacks often aren't reported until months or years after they're discovered. The first known small government ransomware infection hit the small town of Greenland, New Hampshire, in 2013 but the number of attacks didn't explode until 2016, when there were 46. Industry estimates suggest ransomware attacks cost billions of dollars each year, though it's hard to put a precise number on the costs because there's no comprehensive record of attacks across the globe and not all of them are reported.