More than 50,000 commuters faced long delays on their journey to work on Monday after a train became entangled in overhead wires on Sydney's north shore at 4.30am.
The problem was fixed this afternoon, with RailCorp saying services should be returned to normal in time for the commute home.
RailCorp's chief operating officer, Tony Eid, said the problem started when a train driver reported losing power at Waverton on the north shore.
"When he inspected his train at Waverton he reported his train had tangled in the overhead," Mr Eid said.
"This was 4.30 in the morning so thankfully there was no one on board at the time," he said.
In response, RailCorp had to turn off power in the entire area, which affected services south to the Harbour Bridge.
Technicians had to walk the track between Wynyard and Waverton stations to determine that there was no other overhead wiring damage.
Tens of thousands of commuters, meanwhile, had their morning journey disrupted.
"You couldn't have picked a worse spot on the network," Mr Eid said of the Waverton entanglement.
He said about 50,000 people travel north to work between Central and Chatswood between 6am and 9am.
Thousands of commuters joined huge queues for replacement bus services and reported taking hours to get to work.
Officers set up barriers surrounding Wynyard railway station early in the morning after the wiring problem initially stopped all north-bound services between Wynyard and Chatswood.
Buses replaced trains between those stations, but commuters reported huge queues and delays of up to 30 minutes to board replacement buses on Clarence Street.
Trains resumed running between Wynyard and North Sydney just after 8.30am, while a replacement bus service continued to operate between North Sydney and Chatswood until about 10.30am.
A diesel locomotive has removed the train that became entangled at Waverton, but technicians have not yet repaired the wiring. Mr Eid said he had been told it was likely to be repaired by 2.30pm.
Trains are running a limited shuttle service on the North Shore line.
RailCorp had closed the North Shore line for trackwork last weekend, though Mr Eid said it was too early to say if a mistake made in trackwork caused the entanglement.
Three of the four pantographs that connect the train to the overhead wire had become entangled.
"We are committed to getting the job done and we are committed to getting to getting people home in the afternoon," Mr Eid said.
At 9.35am, one commuter, Michael Slezak, had been waiting at North Sydney for 35 minutes but said he had barely moved in the line to board a replacement bus to Chatswood.
"It's pretty nuts. I've never seen anything like it," Mr Slezak said.
He said replacement buses had been arriving, but they had been delayed by peak-hour traffic and struggled to move the volumes of commuters displaced from trains.
"They hardly make a dent," he said, estimating he faced a wait of up to two hours to get to work at Chatswood.
At 10am on Monday, hundreds of people were queued outside North Sydney railway station to catch replacement bus services.
"It was mental. It looks like it has calmed down a little bit compared to what it was earlier this morning, but there are still lots of people," said a worker in a business near the station.
Commuters vented their frustration on social media, including one woman who tweeted that the queue at North Sydney ran around a corner and then doubled back. She caught a taxi to work with her colleagues, who were also caught up in bus queues.
Another commuter said her boss drove to North Sydney station to pick her up.
Just after 10.30am, the Transport Management Centre said the problem at Waverton had been fixed.
"There are train delays on the North Shore line of up to 60 minutes, while there are also flow-on delays across the CityRail network of up to 30 minutes," the spokesman said.
"Delays will begin to ease now that repairs at Waverton have been completed."
He said passengers could use their train tickets for travel on STA Sydney Buses and Sydney Ferries on Monday morning due to the disruption.
A NSW Police spokeswoman said officers were called to set up barriers near Wynyard station as a safety precaution to keep people from spilling on to the road.