A cyber-attack that affected the Ontario government's website on Friday night has been resolved, and service is being restored over the next few days.

Internet users who visited Ontario.ca on Friday evening found that the website had been replaced by a black screen with a photo of a young man and a profanity-laced message calling for visitors to follow a Twitter account.

A video of MC Hammer's song "U Can't Touch This" was also included on the hacked homepage.

The incident on Friday was due to a third-party hosting site that routes traffic to the Ontario website, government spokesperson Samantha Grant said in a statement Saturday afternoon.

“A fix was made by the third party service provider, but it is expected to take up to 24 to 48 hours to fully propagate across their servers. Until that process is complete, some users may still see the hacker's website when they attempt to access Ontario.ca websites," Grant wrote.

"IT security is in contact with Ontario's major internet service providers to help speed up the process."

The hacker's identity is currently unknown, Grant wrote, but police are investigating the incident.

According to the statement, no personal information or government data was ever at risk during the hack.