A massive sewage spill from Mexico's Tijuana River that polluted miles of coastland and shut down beaches in Southern California is under investigation by federal authorities.

U.S. officials have said the spill that caused about 143 million gallons of sewage to leak across the border was deliberate, while Mexican authorities believe it was an accident caused by heavy rain.

The pollution closed beaches and kept surfers and swimmers out of the ocean, drawing outrage from residents of the cross-border region who say they weren't told of the leak until weeks later.

U.S. officials have said the spill that caused about 143 million gallons of sewage to leak across the border and contaminate Californian beaches was deliberate

The tidal wave of raw sewage ran for 18 days and only stopped last week on February 23. The public didn't learn about it until the next day.

The spill is believed to have occurred during repairs to Tijuana's sewage system.

U.S. officials, including Imperial Beach Mayor Serge Dedina, believe the spill was deliberate to cut corners during repair work on a sewer pipeline in Mexico.

Despite high tensions between Mexico and the U.S. after Donald Trump promised to build a border wall, authorities do not believe the spill was politically motivated.

'It was intentional,' Dedina told Reuters. 'The big picture is we need to work to support Mexico's effort to improve the sewage infrastructure system in Tijuana so this doesn't happen again.'

The Tijuana River (pictured) flows across the border near San Ysidro, California

At a raucous public hearing on Thursday night in Imperial Beach, angry residents said they were fed up with continued problems with sewage from Mexico that fouls beaches and endangers their health.

A spokeswoman at the Tijuana State Public Service Commission said the spill was an accident that resulted from heavy rains collapsing a sewage interceptor in the city. They said they notified the International Boundary and Water Commission, which is a joint U.S.-Mexico agency.

The commission, which is leading the investigation, was notified on February 23 but U.S. officials believe the spill started at least two weeks earlier and dumped roughly 143 million gallons of sewage into the Pacific Ocean.

Contact with raw sewage can cause serious infections and illnesses such as diarrhea.

The sewage spill polluted 20 miles of coastland from the areas of Rosarito in Mexico to Coronado in California.