Downing Street, the office of Prime Minister Cameron and the Home Office said attempts to disrupt the work of their sites had failed or caused minor problems.
Hackers have targeted British government websites in the last 24 hours, the government said on Tuesday, after activist hacking group Anonymous said it had launched attacks to protest against the handling of the case of WikiLeaks' founder Julian Assange.
Downing Street, the office of Prime Minister David Cameron, and the Home Office said attempts to disrupt the work of their sites had failed or caused minor problems, although the Ministry of Justice (MoJ) said the attack had affected its website.
The incident comes as Assange - who is trying to avoid extradition to Sweden where he is wanted for questioning over rape allegations - remains holed up in the Ecuadorean Embassy in London. He and Ecuador have criticized the British government for suggesting it might revoke the embassy's diplomatic status in order to enter and arrest him.
"This is a public information website and no sensitive data is held on it. Measures put in place to keep the website running mean that some visitors may be unable to access the site intermittently," an MoJ spokeswoman said.
Downing Street was dismissive of the incident.
"There may have been an attempt but as far as we are concerned it was unsuccessful," a spokeswoman said.
All the websites appeared to be functioning normally on Tuesday. Anonymous, a loose-knit group of international hackers, suggested it was behind the attacks which it linked to the Assange case.
"Justice.gov.uk seems to be offline. Odd. #Anonymous #Assange," said a posting on the group's Twitter website at the time of the attacks on Monday night.
It later added: "Sorry for the delay Forgot to say no3 #TangoDown aprox 1 hour ago ;) number10.gov.uk/ #OpFreeAssange."
Britain has said Assange will be arrested and deported if he emerges from the embassy after Ecuador granted him political asylum last week. He says he is the victim of a U.S.-led witch-hunt over his whistle-blowing website.
Anonymous has carried out a number of attacks on British and international government departments, usually using a distributed denial of service tactic, where a website's host computers are bombarded with requests for information, making them crash. It has also targeted companies it deems have worked against WikiLeaks' interests including Visa and Mastercard.