A water main break caused a major disruption on the L train subway line on Wednesday, forcing transit officials to briefly shut service between Brooklyn and Manhattan and upending the morning commute for thousands of people.

The water main break drove water into the subway system around 4:30 a.m. near the Bedford Avenue station in Brooklyn, officials said.

As a result, transit officials suspended service for roughly three hours between the 14th Street-Union Square station in Manhattan and the Myrtle Avenue station in Brooklyn.

The Metropolitan Transportation Authority, which operates the subway, was running the L train line in two sections — one in Manhattan and one in Brooklyn. By about 7:30 a.m., the agency reported that L train service had resumed under the river but with “extensive delays in both directions.”