Thousands of angry dockworkers marched at the Port of Los Angeles. Eleven thousand area residents signed petitions. A score of state, city and county politicians raised objections. Mayor Eric Garcetti has led weeks of negotiations, calling for a compromise.

But a three-month battle over whether robots will replace jobs at the Port of Los Angeles may be all but over.

In a letter Monday to Garcetti and the Los Angeles City Council, Maersk, the global shipping giant, announced it will move ahead with introducing driverless cargo carriers at its port terminal, the nation’s largest, regardless of the outcome of a City Council vote on the project scheduled for Friday.

The first of the 45-foot-high robotic machines, which transfer containers from ships to trucks, are already on their way from a factory in Poland, and scheduled to arrive in late July, the company said.

Maersk subsidiary APM Terminals “has the undisputed right under its lease and its collective bargaining agreement to introduce automated technology of this sort and does not require any permit or any other port, city or state approval,” according to the letter, signed by Wim Lagaay, chief executive of APM Terminals North America, and Lee Kindberg, Maersk’s director of environment and sustainability.

The International Longshore and Warehouse Union, which represents more than 10,000 dockworkers at the twin ports of Los Angeles and Long Beach, acknowledged that its contract allows automation. But workers, faced with the possibility of hundreds of job losses, rose up and prompted the union to challenge a minor permit for the APM carriers’ electric chargers and other equipment in hopes of blocking the whole project.

If Maersk’s letter threw down a gauntlet, talks were nonetheless scheduled to continue Wednesday between the terminal, city and port officials and ILWU Local 13 that could partly mitigate job losses, with diesel mechanics gaining skills to maintain the new machines.

Without its requested permit for electric infrastructure, Maersk plans to bring the new automated carriers into the port fitted with diesel motors to charge their batteries — thus bypassing the need for chargers, Wi-Fi antenna poles and related equipment. Twenty-seven carriers are to arrive at the terminal by the end of the year, with about 100 more on order after that.

Maersk contends labor costs must be cut to compete with ports on the East and Gulf coasts. ILWU Local 13 President Ray Familathe recently estimated that 500 daily “job opportunities” for union shift workers could be lost. APM Terminals’ Lagaay said that “is not unrealistic.”

The automated carriers would operate 24 hours a day, as opposed to the 16 hours of shifts manned by dockworkers now, the company said. And they would reduce average turnaround times for the more than 4,000 trucks that enter the 484-acre terminal daily from 105 minutes to 35 minutes.

Monday’s letter was prompted by what Lagaay called “a misunderstanding” by Councilman Joe Buscaino, who has asked the City Council to veto the Board of Harbor Commissioners’ approval of the construction permit last week. “Action by the City Council to veto the permit will not prevent automation,” the letter said.

Buscaino called the letter an attempt “to minimize the major impacts on the health and well-being of our communities. Automation is a subject, like climate change, that we must address collectively and with focus, so that the ability of humans to sustain themselves is not decimated.”

The City Council “must fully vet and understand the implications of APM’s permit before it moves forward,” he said.

Opposition to Maersk’s move grew Tuesday as the Los Angeles County Board of Supervisors approved a motion to write Garcetti and the City Council “to support the efforts of the International Longshore and Warehouse Union.” The measure, sponsored by Supervisor Janice Hahn, who represents the port area, also directed the county’s chief executive to study the economic effect of port automation and report back in 90 days.

“Technological advancements should not come at the cost of good-paying union jobs,” the motion said.

ILWU officials did not respond to requests for comment.

If the parties reach a deal, Friday’s City Council action could be called off, a Buscaino spokesman said.

By replacing fully electric cargo carriers with hybrid-electric carriers combining batteries and a diesel motor, “the impact to our planned modernization project is that all stakeholders lose the benefits to the environment,” the Maersk letter said.

The company said once the roughly 130 automated carriers are converted from hybrid diesel-electric to fully electric, they would save 2.2 million gallons of diesel fuel a year. That estimate includes fuel saved not just by the robotic machines themselves, but by thousands of trucks that wait hours in line to enter terminals with engines idling. Rather than drive around the terminal’s 26 miles of road, the trucks would park outside the container storage yard and the robotic carriers would bring the cargo to them. The fleet would operate on Wi-Fi and could be programmed remotely by a reduced staff of operators on port premises, Lagaay said.

The twin ports’ Clean Air Action Plan encourages terminals to use the cleanest available cargo equipment and sets a goal for zero-emission handling equipment by 2030. The Los Angeles-Long Beach port complex, which handles about 35% of U.S. imports, remains the largest single source of air pollution in Southern California.

Port Executive Director Eugene Seroka, who supports Maersk’s electrification permit, has called it a way to “modernize APM Terminal.” The ports “want to get to a level of zero emissions,” he said in an interview. “Without this permit it makes it more complicated.”

Seroka noted that even as two smaller terminals, one in Long Beach and one in Los Angeles, have adopted automated equipment “in the last 15 months, the industry has hired 1,000 registered longshore members and 4,000 to 5,000 casual workers or apprentices. It’s the largest uptake of new workers in a generation.”

Independent forecasts show cargo container volume doubling at the Port of Los Angeles over the next two decades, Seroka said. So even with terminals adopting automation, “my belief is we will need more workers,” he said. “How many more is the question.”

As for the future of work at the port, negotiations will continue between the union, the terminals and the port no matter what action the City Council takes this week, he said.

“We will continue to work together. People are trying to find solutions. It is not always smooth or easy.”