Hundreds of motorists got stuck in traffic Wednesday afternoon and evening after part of the Casco Bay Bridge got stuck in an upright position for more than two hours.

A malfunction in an electrical switch on the drawbridge caused one of the two lifts on the northbound side to lock up, said Ted Talbot, a spokesman for the Maine Department of Transportation.

The lifts on the southbound side of the bridge, which carries traffic from Portland to South Portland, were not affected.

The problem forced an inbound cargo ship, carrying a 286-ton electrical transformer to the Merrill Marine Terminal on the Fore River, to turn around.

The BBC Congo and its crew had to moor off Fort Gorges Wednesday night, according to the Coast Guard. The ship was expected to make its delivery for Central Maine Power Co. around 5:30 a.m. Thursday.

“The volume of traffic was the issue” with the bridge malfunction, said South Portland police Lt. Frank Clark. “As Murphy’s Law would have it, it happened during rush hour.”

Authorities said the drawbridge malfunctioned around 4 p.m. and was not fixed until 6:15 p.m.

Southbound traffic going from Portland to South Portland was allowed to pass over the bridge, but the northbound lanes were shut down.

South Portland police got drivers off the northbound side of the bridge within an hour or so as an officer helped them make U-turns.

The loss of one of Greater Portland’s major commuting routes forced drivers onto other roads including Broadway in South Portland, which police said was jammed from the Casco Bay Bridge to outer Broadway, near the municipal golf course.

“The traffic overwhelmed the city. January in a blizzard would have been better,” said police Sgt. Adam Howard.

“It was frustrating but there was nothing I could do about it,” said Shane MacDowell, who was returning to his home in South Portland from his coaching job in Yarmouth. He took the Interstate 295 exit near Pape Chevrolet, which led him back to Broadway near the golf course.

“Traffic was moving, but not very fast,” said MacDowell.

Roger Knight, who owns a business on Anderson Street in Portland, near Marginal Way, thought Wednesday would be a good day to walk to and from work. He ended up getting stuck on the Casco Bay Bridge as he tried to return to his home in South Portland.

“Luckily, I have no commitments tonight,” said Knight as he stood and watched traffic crawl across the bridge on the southbound side, heading into South Portland. Knight decided against walking on the same side as the moving traffic, for fear of getting hit.

“I could cross over, but the drivers are not paying attention and they are frustrated,” he said.

Once the bridge reopened, Knight said, he was heading to the Snow Squall restaurant in Knightville for a drink.

Talbot, the transportation department’s spokesman, said an electrician would be on the bridge when the cargo ship passed under it early Thursday morning.

The electrical switch that malfunctioned was left in place Wednesday night and appeared to be operating, but it will be replaced on Thursday, Talbot said.

“None of the alarms went off. There was no sign of corrosion or dampness. We are not sure what caused it to malfunction,” Talbot said. “But we truly regret the inconvenience this caused motorists.”

The Casco Bay Bridge, which opened in 1997, is owned and operated by the state.

Dennis Hoey can be contacted at 791-6365 or at:

dhoey@pressherald.com