Officials in an Ontario beach town spent several weeks unable to access government data because their computers had been taken over by hackers.

The Town of Wasaga Beach says all of its data was locked April 30 as part of a ransomware scam, in which malicious software is utilized to block users from using computers until a ransom is paid.

The scammers initially demanded 11 Bitcoins, worth approximately $144,000 at the time, to release the 11 servers.

After seven weeks communicating with hackers via 鈥渟ecure encrypted email,鈥 the town was able to negotiate the price down to three Bitcoins, or about $35,000, for four servers containing the vast majority of the town鈥檚 data. No personal information was compromised.

鈥淚t was like living in a spy movie,鈥 said chief administrative officer George Vadeboncoeur, who made the decision to pay the hackers after seeking expert advice. The $35,000 paid seemed like pennies compared to the alternative. 鈥淲e would have been into hundreds of thousands of dollars, because we would have had to start from scratch to recreate everything,鈥 he said.

鈥淭his seemed like a small price to pay in order to get the data back.鈥

Factoring in payments to consultants and other experts as well as overtime and lost productivity costs, town officials estimate that the total cost of the hack to Wasaga Beach surpassed $250,000. The costs are presented to town councillors Tuesday night.

鈥淚t鈥檚 very unfortunate when it happens, it鈥檚 extra unfortunate when it鈥檚 public dollars,鈥 said councillor Sylvia Bray. The town had to dip into its reserve fund to pay for the ordeal.

The town has since built a new network, which is believed to be safeguarded against a repeat attack. Additional backup servers have also been installed, and the town鈥檚 leaders say they鈥檝e developed a better understanding of how to protect their corporate security.

鈥淲e are well positioned to weather the storm and move forward,鈥 said councillor Joe Belanger. 鈥淭his could have been devastating.鈥

With a report from CTV Barrie鈥檚 Beatrice Vaisman.