The government ruled out any cyber attack behind the disruption.
"All government websites have been restored and the technical problems have been resolved," Press Information Bureau said in a Twitter message.
After remaining inaccessible for a few hours, the websites were restored at around 9 pm.
The PMO website, along with those of the Lok Sabha, Rajya Sabha and key ministries such as finance and defence, were not accessible this evening.
The PIB, whose website too was down in the evening, had earlier tweeted: "Govt clarifies that there was no cyber attack or hacking of Govt websites. Due to malfunctioning of some equipment, some sites were down."
It said services would be restored soon, although no time line was given at that time.
Officials of the National Informatics Centre, which hosts the websites, had said they were looking into the outages.
The officials said the websites encountered some technical glitches because of which they became inaccessible.
"From evening there has been a glitch. It is being looked into by the National Informatics Centre and the websites which are encountering problems will be restored," a senior official said.
Earlier while efforts at reaching the websites of the law, oil and agriculture ministries yielded no results, a message, "the specified URL cannot be found", appeared on the website of the finance ministry.
Websites of the information and broadcasting ministry, Department of Telecommunications and the Department of Electronics and Information Technology also remained unavailable.
All about Modi's PMO
How secure are the EVMs?
'Strict decisions have to be made for the good of the poor'
Industry lauds govt's move to promote e-auction
UPA appointed NDMA vice-chairman resigns