SOUTH PORTLAND, Maine — The South Portland City Council on Monday earmarked nearly $500,000 to defend a law it passed last year preventing the on-boarding of crude oil along the city’s waterfront.

The “Clear Skies” ordinance effectively prohibits pumping tar sands oil through the Portland-Montreal Pipeline to South Portland, where the fuel could then be transported by ship.

The law came in response to concerns that pumping the thick mix of oil, sand and clay would endanger Maine’s water resources.

On Monday, councilors unanimously agreed to set aside a total of $450,000 from the 2016 city budget of $95.5 million to pay for legal defense of the ordinance. The city’s unassigned fund balance will provide $200,000, with the rest of the money coming from revenue such as property and excise taxes.

In addition, the council formally accepted donations of about $5,300 that have been made to the city’s Clear Skies Defense Fund.

To date, the city has spent about $130,000 in legal fees associated with the ordinance, according to officials.

The ordinance, enacted in July 2014 after months of heated protest, was widely expected to meet legal challenges. The council created its war chest just weeks after the ordinance’s passage, and indeed, the pipeline’s operator, Portland Pipe Line Corp., sued in February to overturn the law.

In its suit against the city, the company claims the Clear Skies ordinance violates laws protecting international and interstate commerce. The city is seeking dismissal of the suit on the grounds that the company has no plans to pump oil to South Portland.

Lawyers for both sides have declined to discuss the case while it’s pending.

At Monday’s meeting, Councilor Claude Morgan said approving the defense funds was more than “housekeeping.”

“[The defense] should deeply resonate with folks,” he said. “I have heard overwhelming support for this ordinance. … There’s a great deal at stake in the long term. And by necessity, [the ordinance] must be sustainable.”

Mayor Linda Cohen echoed Morgan, although she noted she’s received “pretty nasty communications” about the ordinance and wishes the city could spend the defense funds on other priorities.

“But it doesn’t make sense to pass an ordinance and then not defend it,” she said.