Mayor Martin J. Walsh yesterday came out swinging against the MBTA for weighing the privatization of core functions such as bus routes and maintenance, calling it a “mistake” that could pave the way to widespread outsourcing at the cash-strapped agency.

“It’s a slippery slope. It’s a dangerous way to go,” Walsh told reporters after speaking to a pro-labor crowd at the Greater Boston Labor Council’s annual Labor Day breakfast. “When you talk about privatization, in an initial contract, it always seems like it’s going to save money. Long-term it doesn’t save money, the costs go up. I’ve had some conversations with the governor about this.

“I think it’s a mistake,” Walsh later added. “Privatizing the whole MBTA is not the way to go.”

The Herald reported on Saturday that the MBTA is taking a hard look at private contracts within its massive operations and maintenance departments, which account for $875 million of spending each year.

The T’s Fiscal Management and Control Board, writing in a report filed with lawmakers, said the agency is “beginning to actively examine” the possibility, citing areas such as its bus operations, where the T’s bus drivers, at $35.86 per hour, are the highest-paid in the country, according to a T analysis.

Under the law Gov. Charlie Baker signed last year, the T has just a three-year window — or through mid-2018 — to identify areas to privatize without the restraints of the so-called Pacheco Law. Facing a $110 million deficit, the T has thus far sought out private vendors for smaller departments, such as its parts warehouse and its “cash” room.

“When you look at the money room, that’s one thing,” said Walsh, a former head of the Boston Building Trades Council. “But when you talk about going systemically across the system, I think that’s a problem.”

One board member has said that there is no “magic number” that would limit how widespread privatization could go. The MBTA has said that “leveraging flexible contracting remains a critical tool” for the agency as it seeks out savings.

At yesterday’s Labor Day breakfast, signs of opposition littered the Park Plaza Hotel ballroom, including one that read in all capital letters: “Keep Public Transportation Public!!!!! Stop MBTA Privatization.”

Steve Tolman, president of the Massachusetts AFL-CIO, echoed the message, telling the crowd that “investment, not privatization, is the way to a better public transit system.”