PORTLAND — Traffic is flowing in both directions on the Casco Bay Bridge after a drawbridge on the northbound side of the bridge malfunctioned, forcing authorities to close the side of the bridge that motorists use to enter Portland from South Portland.

Traffic was able to cross the bridge from Portland into South Portland during the closure.

Roger Knight, a pedestrian who had been stuck on the bridge, reported that traffic began moving in both directions about 6:15 p.m.

The incident happened at 4 p.m. The bridge spans the Fore River and is the primary connector between the two cities. It is especially busy during commuting hours.

The tanker BBC Congo was being helped through the opening in the bridge by tugboats when the malfunction occurred, but it had room to stop and reverse course, according to the Coast Guard. The ship was being anchored outside the harbor until the problem is resolved.

The bridge was opening and one of the leaves did not operate correctly, said Dale Doughty, head of maintenance operations for the Maine Department of Transportation.

“This is a problem we have not encountered previously,” said Ted Talbot, spokesman for the Department of Transportation.  “No alarms were triggered.”