The Canadian government's public website for applying for social services and downloading official forms was briefly shut down on Wednesday due to a cyberattack, a senior minister said.
Several other government websites including those of Parliament, Industry Canada and Public Works also appeared to be down.
"Confirmed today that the Govt of Canada GC servers have been cyberattacked," Treasury Board President Tony Clement said in a Twitter message.
The hacker collective Anonymous took responsibility for the breach in an online video, saying it was done in protest of a controversial anti-terror law that dramatically expands the powers and reach of Canada's spy agency.
Bill C-51, said the group of hackers, violates Canadians' civil rights, and targets "minority groups and dissidents.
""Do we trade our privacy for security?" asked an electronically masked voice in the video.
The bill was enacted in response to the first terror attacks on Canadian soil last October, when a gunman killed a ceremonial guard and stormed Parliament, and a soldier was run over in rural Quebec.
However it has been widely decried as overreaching and an unprecedented assault on civil rights.
The bill criminalizes the promotion of terrorism, makes it easier for police to arrest and detain individuals without charge and expands the Canadian Security Intelligence Service's (CSIS) mandate from intelligence-collection to actively thwarting terror plots and spying outside Canada.