Megan Varner/Getty Images

Florida, Virginia, Georgia and North Carolina declared states of emergency as residents panic buy gasoline, leading to gas shortages.

Gas prices soared and fears of a nationwide shortage caused people to panic buy gas after a cyber attack shut down a major gas pipeline over the weekend.

The national average for retail gasoline was $2.985 on Tuesday -- the highest since November 2014.

Megan Varner/Getty Images

Panic buyers lined up outside gas stations in Atlanta on Tuesday, May 11. Some drivers walked up with gas cans after bypassing stations that were closed.

The FBI has confirmed that Russian hacking collective DarkSide is responsible for the ransomware cyber attack that crippled a Georgia-based fuel pipeline.

Colonial Pipeline, which is operated out of Alpharetta, near Atlanta, is the largest pipeline on the East Coast. It runs from Texas to New Jersey and transports 45% of the East Coast's fuel supply, including gasoline, diesel fuel and jet fuel.

Colonial officials announced it shut down the pipeline out of an abundance of caution after discovering the ransomware.

Ransomware is a type of malware that locks a company's data and threatens to delete the data unless a ransom is paid, typically in Bitcoin.

The attack is unleashed after an employee unwittingly clicks a phishing link in an email that impersonates an individual or company known to the employee.

Hundreds of major corporations and even hospitals have been hit by ransomware cyber attacks over the years.