Google inadvertently thwarted Baltimore’s attempt to combat a major ransomware attack against the city earlier this week.

The Baltimore Sun reports that Baltimore set up multiple Gmail accounts after the ransomware attack, which affected the city’s email system, as well as services such as online payments.

On May 23, Google’s automated systems mistakenly perceived the numerous Gmail accounts as the work of spammers. The tech giant says that it has solved the issue, enabling Baltimore officials to use Gmail.

CYBERSECURITY EXPERTS WARN BALTIMORE TO STOP 'PLAYING' WITH RANSOMWARE ATTACKS

"We have restored access to the Gmail accounts for the Baltimore city officials,” it explained in a statement emailed to Fox News. “Our automated security systems disabled the accounts due to the bulk creation of multiple consumer Gmail accounts from the same network."

File photo - a man sits on a park bench overlooking Baltimore harbor and skyline, Baltimore, Maryland. (Photo By: Education Images/UIG via Getty Images)

Citing a spokesman for Baltimore Mayor Bernard Young, the Baltimore Sun reports that the issue was resolved on Thursday after officials contacted senior executives at Google.

Another city spokesman initially told the Baltimore Sun that Google said the new accounts were "circumventing" a paid service that Baltimore would require for a business account.

The computer servers were hit by the cyber attack on May 7 and city officials quickly shut down most servers. The city put a statement on its website saying that it "is currently unable to send or receive email.” If residents need service from the city, they have been asked to call the city department they need to contact.

Officials have said hackers using the ransomware variant RobbinHood demanded the city pay the equivalent of $76,000 in bitcoin, which Mayor Young says won't happen. The deadline for payment was May 17.

CITY OF ATLANTA HIT BY RANSOMWARE ATTACK

Fox News has reached out to Baltimore officials with a request for comment on this story.

In a ransomware attack, hackers typically encrypt a computer network’s data to hold it “hostage,” providing a digital decryption key to unlock it for a price.

SCARY RANSOMWARE ATTACKS FAMOUS NORTH CAROLINA COUNTY

Last year, the City of Atlanta was targeted in a ransomware attack that impacted a number of its systems.

Attacks have taken place across the U.S. Hackers, for example, targeted the port of San Diego in a ransomware attack that disrupted the agency’s IT systems. An Alaskan borough also had to dust off its typewriters following a major ransomware attack.

In 2017, a major ransomware attack forced the shutdown of a host of IT systems at Mecklenburg County, North Carolina.

ALASKAN BOROUGH DUSTS OFF TYPEWRITERS AFTER RANSOMWARE ATTACK

Also in 2017, a hacker targeted Sacramento Regional Transit, deleting 30 million files in a ransomware attack. Officials worked to restore the data from backup files.

CLICK HERE TO GET THE FOX NEWS APP

In 2016, a Los Angeles hospital paid a ransom of nearly $17,000 in bitcoins to hackers who infiltrated and disabled its computer network.

Fox News’ Barnini Chakraborty and the Associated Press contributed to this article. Follow James Rogers on Twitter @jamesjrogers