Canadian National Railway Co. experienced a network-wide system failure on Tuesday afternoon that affected Via, GO and other trains in Ontario. After causing chaos for commuters during the evening rush hour, the issue was resolved and service was restored Tuesday night.

"CN's internet connectivity has been restored," a CN spokesperson said in an update Tuesday evening. "While there continues to be no indication of a cybersecurity issue, the cause of the outage remains under investigation."

Earlier in the day, a CN spokesperson explained that "an internet connectivity issue" had affected GO and Via Rail trains arriving and departing Toronto's Union Station.

The outage was first reported Tuesday afternoon. Limited service resumed Tuesday evening and regular schedules were restored later in the night.

The city's main passenger rail hub, Toronto's Union Station was crowded with commuters looking to get home after work on Tuesday. By the evening, trains were trickling out of the station every 30-or-so minutes after being halted for much of the afternoon.

Ontario transit agency Metrolinx expected delays and cancellations to stretch into the evening.

"Our top priority is getting people home from Union Station, which is very busy tonight," Metrolinx said in a statement. "Trains are expected to be very busy, so please continue to explore alternative ways to get to your destination this evening – or consider travelling later this evening when trains and buses are expected to be less busy."

Commuters at Union Station

The TTC increased subway, streetcar and bus service to deal with the influx of passengers. Prices on ride sharing apps reportedly skyrocketed amid the disruptions.

"There is a CN network-wide system failure that is affecting all of our rail corridors," a statement from Ontario's GO Transit and Metrolinx explained earlier in the day. "Our teams are working with CN to resolve the issue quickly and safely."

In an online statement, Via Rail Canada said some trains entering and departing Toronto's Union Station were experiencing delays due to the CN system failure.

Toronto's UP Express airport train was also impacted and was operating at a reduced schedule following an earlier service disruption. GO Transit and the UP Express are both operated by Metrolinx, an Ontario Crown corporation.

On social media, passengers reported waiting on affected trains for hours.

EXO service in Quebec, as well as CN and Amtrak trains, are operating, according to CN.

"GO Transit has now resumed dispatching their lines and they are working to resume their normal movements," the CN spokesperson said Tuesday night. "CN will be working with GO to review the incident and put in place processes to avoid further disruptions."

With files from CTV News Toronto