NORWALK -- This time it was a 118-year-old balky bridge that caused headaches for thousands of rail commuters.

A 562-foot swing bridge over the Norwalk River became stuck in the open position for five hours Thursday morning, interrupting Metro-North service on its busy New Haven Line, causing delays of an hour or more. Shuttle buses were used to ferry passengers between the South Norwalk and East Norwalk stations.

Amtrak trains were also halted for a time, stranding passengers on its Northeast Regional service between New York and Boston.

The bridge, which opens regularly for marine traffic, failed to pivot back into its closed position just after 4 a.m. during a test of the span to ensure it was operating correctly, according to Marjorie Anders, a spokeswoman for Metro-North Railroad. The tests are done monthly, she said.

Repairs were completed shortly before 9 a.m., but with backlogged trains waiting at stations along the line, normal service did not resume for several hours.

The breakdown is the latest in a string of outages arising from the state not funding projects to replace or overhaul the rail bridge over the Norwalk River, and three other bridges on the New Haven Line, in Greenwich, Westport, and Milford, all of which are now more than 110 years old. In recent years, the bridges have had difficulty in extremely hot or cold weather when the metal fittings expand and contract. But now the aging bridges have also become increasingly prone to problems when they have to be opened for boat traffic.

The five hours it took to fix the bridge is on the longer side for recent outages, including one that lasted about 90 minutes last June, disrupting a Friday afternoon rush hour.

"Sometimes these things take an hour and a half to fix, sometimes they take hours," Meredith Daniels, a spokeswoman for the Metropolitan Transportation Authority, which operates Metro-North Railroad.

The Coast Guard requires Metro-North to open rail bridges for marine traffic on demand, but the state obtained a partial exemption for the rule in the case of the Norwalk bridge, allowing it to stay closed during peak periods. Under the exemption granted by the Coast Guard in 2007, Metro-North can keep the bridge down from 7 a.m. to 8:45 a.m. and 4 p.m. to 6 p.m. on weekdays. However, at most other times the railroad is required to "immediately" open the bridge for commercial vessels and to not exceed a delay of more than 20 minutes to do so for all other waterborne traffic.

"We would love to keep the bridges closed all the time," Connecticut Department of Transportation spokesman Judd Everhart said.

In 2010 Metro-North and the DOT pushed off the 2014 start date to replace the Norwalk and Saugatuck River movable bridges in favor of putting funding toward expediting the full replacement of the New Haven Line's overhead catenary power system by 2017 instead of 2021.

In April of this year, the state applied for a $349 million share of federal Hurricane Sandy resiliency funding to help replace the bridge, arguing it is vulnerable to damage in major storms. If successful, construction could begin in 2018.

The request was part of a $600 million grant request to improve the storm-resilience of Connecticut's aging rail infrastructure overall.

Everhart said that without the grant money the railroad doesn't have any other source of funding in place to start work on the Norwalk bridge, which is known as the "Walk" bridge in the Department of Transportation and Metro-North vernacular.

The newly designed bridge would be a single span bascule bridge that would have two movable two track structures that would allow one side of the bridge to operate if the other malfunctions, according to the Department of Transportation.

"We are waiting to hear on the Sandy application before we make a decision on some other alternative for replacing the Walk bridge," Everhart said.

Andrew Doba, a spokesman for Gov. Dannel P. Malloy, said in an email Thursday that the governor believes "federal investment along the entire Northeast rail corridor is long overdue."

For many frustrated commuters, the latest recurrence of the problem on Metro-North meant that their workday was ruined, and that it wouldn't be the last of them interrupted by the aging bridges.

Curtis Wills was headed to his job in New York City. "I commute almost daily and there always seems to be some problem. I won't get in until lunchtime. My whole day is shot," he said.

Neco Malillo, a Fairfield Prep student from Norwalk, was waiting for an eastbound train at 7:30. "I have a test in second period, about 10," he said. "I should make that."

One Greenwich commuter said, "The winter was awful. We just got the new schedule. Here we go again."

In East Norwalk, Robert Rowlan and Alex Calendar went into New York City on Wednesday for the Phil Lesh and Friends concert in Central Park. The two men live in Rhode Island and were trying to get home in the morning.

"We took the 2:40 a.m. Amtrak from the city, but when we got to South Norwalk the conductor said it was the last chance to get off, that they were going back (to New York)," Calendar said.

"We took a cab from there to here and we're planning to get onto Metro-North to New Haven."

Rowlan said they were hopeful of getting home for dinner. "We'll get back on Amtrak in New Haven and take it to Providence. That's the plan, anyway."

One Stamford woman who was supposed to catch the 7:25 a.m. train into Grand Central had to wait to step onto a train coming through the Stamford station at 7:44 a.m.

"This is bogus. There should be some contingency plan in place when you have this kind of thing happen instead of delaying thousands of commuters. Something is happening all the time it seems," the woman said before spotting an incoming train and running down the steps to the platform.

Reporters John Nickerson, Anne Semmes and the Associated Press contributed to this report.