Libraries in St Louis have been bought to a standstill after computers in all the city’s libraries were infected with ransomware, a particularly virulent form of computer virus used to extort money from victims.

Hackers are demanding $35,000 (£28,000) to restore the system after the cyberattack, which affected 700 computers across the Missouri city’s 16 public libraries. The hackers demanded the money in electronic currency bitcoin, but, as CNN reports, the authority has refused to pay for a code that would unlock the machines.

As a result, the library authority has said it will wipe its entire computer system and rebuild it from scratch, a solution that may take weeks.

On Friday, St Louis public library announced it had managed to regain control of its servers, with tech staff continuing to work to restore borrowing services. The 16 libraries have all remained open, but computers continue to be off limits to the public.

Spokeswoman Jen Hatton told CNN that the attack had hit the city’s schoolchildren and its poor worst, as many do not have access to the internet at home. “For many … we’re their only access to the internet,” she said. “Some of them have a smartphone, but they don’t have a data plan. They come in and use the wifi.”

As well as causing the loans system to seize up, preventing borrowers from checking out or returning books, the attack froze all computers, leaving no one able to access the four million items that should be available through the service.

The system is believed to have been infected through a centralised computer server, and staff emails have also been frozen by the virus. The FBI has been called in to investigate.

Ransomware has become increasingly popular as a weapon with which to extort money from corporations, public authorities and institutions and rich individuals. The FBI estimated that, in the first three months of 2016, $209m was conned out of victims and has warned that incidents will increase as hackers become more sophisticated in their attempts to dupe computer users.

Victims are hacked by clicking on an innocuous looking attachment or website link within an email. This releases malicious software that disables the victim’s computer system and any computers on the same network.

Ransom notes then appear across the network demanding money paid in Bitcoin in return for a decryption key that will disable the virus. However, there is no guarantee that the key will work or prevent further attacks.

Last year, the FBI cyber division assistant director James Trainor warned that attacks were becoming increasingly sophisticated. “These criminals have evolved over time and now bypass the need for an individual to click on a link,” he said. “They do this by seeding legitimate websites with malicious code, taking advantage of unpatched software on end-user computers.”

Security software specialist Malwarebytes estimated that as many as two-fifths of businesses in the UK, US, Canada and the Germany were hit by ransomware attacks in 2016.