Fastly said "the issue has been identified and a fix has been applied. Customers may experience increased origin load as global services return."
In a later tweet, it said: "We identified a service configuration that triggered disruptions... Our global network is coming back online."
When it sent that tweet at around 1110 GMT, access was restored to a vast majority of the sites.
Experts told AFP said an external attack appeared unlikely.
Messages such as "Error 503 Service Unavailable" and "connection failure" appeared on the websites of CNN, the Financial Times, The Guardian, France's Le Monde newspaper, Italy's Corriere delle Serra and Spanish daily El Mundo as well as social and entertainment site Reddit.
The White House and gov.uk websites had an error message but were available again later.
The BBC and the New York Times were temporarily inaccessible, but also later returned.
A number of websites were down in the Nordic region including those of Swedish newspapers Aftonbladet and Svenska Dagbladet, news aggregator site Omni, as well as the site of the Swedish social security service Forsakringskassan.
In Denmark, the website of TV2.dk was also down before later returning.
Down Detector, which specialises in internet access problems, said the outages were due to a massive glitch in Fastly.
Fastly is a San Francisco-based content delivery network that helps websites speed up loading times and present their content to users.
It does this by hosting proxy sites around the world to prevent all requests to access websites from causing a traffic jam.
This service is used in particular by highly trafficked websites with audiovisual content, such as media sites.
Companies like Fastly and its competitor Cloudflare handle hundreds of billions of such requests every day, playing an important if not widely known role in global internet access.
Fastly's clients include Deliveroo, Pinterest and Shazam, and its turnover last year was $291 million.