The U.S. agency that operates the National Weather Service said on Wednesday four of its websites were hacked in recent weeks, becoming the latest federal agency to fall victim to a cyberattack.

"In recent weeks, four NOAA websites were compromised by an Internet-sourced attack," said Scott Smullen, a spokesman for the National Oceanic and Atmospheric Administration.

NOAA staff detected the attacks and responded immediately, performing maintenance on the sites, which were restored to full service, Smullen said in an email.