Prominent labor leaders led a protest at the Department of Water and Power’s downtown headquarters on Tuesday, in an effort to preserve funding for two controversial workers institutes.

Speakers from the Los Angeles County Federation of Labor, the International Brotherhood of Electrical Workers and other groups warned City Hall of retribution for withholding payments.

City officials, led by Mayor Eric Garcetti, have been trying to determine for months how the Joint Training Institute and the Joint Safety Institute have spent much of the $40 million provided by the public utility.

“They’re looking for trouble, and I know you can give it to them,” Brian D’Arcy, business manager of IBEW Local 18, told the cheering crowd. One civil rights leader suggested the union could shut off the city’s water and power.

After the IBEW refused to detail the institutes’ finances, the DWP Board of Commissioners voted to cut off funding in November, pending an audit. So far, the union has blocked a city controller’s audit in court. Commissioners would have to vote again to withhold the roughly $4 million annual July payment, and IBEW Local 18 is now enlisting the broader labor base to pressure officials.

“We’re here to represent the whole labor movement with one message ­— a deal is a deal,” said Maria Elena Durazo, Los Angeles County Federation of Labor’s executive secretary-treasurer.

She and other organizers said the DWP management, which jointly oversees the institutes, must adhere to its payment agreement.

City officials maintain that the nonprofit institutes need to hand over financial records.

“This is a simple issue: The ratepayers should have the right to know how their money is being spent,” Garcetti said through a spokesman after the rally.

For his part, D’Arcy wouldn’t answer questions about transparency and the $40 million. He hurried away from reporters Tuesday and referred questions to his spokespeople, who also wouldn’t address the expenses.

The demonstration blocked a section of Hope Street with hot dog grills, a stage and booths. Organizers said more than 1,500 people attended. Many were DWP workers, carrying signs and wearing shirts supporting the institutes. Workers said they took personal time off or walked outside the building on a break.

DWP power engineer Vahan Barseghian said city officials were being shortsighted because withholding funding could jeopardize safety. The institutes get $4 million annually to improve relations between management and labor, specifically concerning safety and training. The DWP spends more than $117 million more on training and other safety programs.