The St. Paul City Council on Wednesday approved virtually everything that Mayor Chris Coleman wanted in the city’s 2015 budget, including $34 million to tackle the “Terrible 20” streets, the 8-80 Vitality Fund for urban rejuvenation and paid parental leave for city employees.

But then the council, using a financial stratagem that Rube Goldberg would have admired, transformed economic development funds into dollars to keep seven branch libraries open longer — and the mayor drew the line, pledging to line-item veto the $345,000 that the council approved for expanded hours.

“We have been exceedingly generous in the amount of resources we’ve directed toward the libraries, but we’re not just a city of libraries. We have a lot of needs out there,” Coleman said.

It’s a battle that he will likely lose, given that the City Council approved the measure on a veto-proof 6-1 vote.

“We have been saying for the last three months that we’re going to increase library hours, so this should not have been a surprise to anyone,” Council President Kathy Lantry said.

But the mayor has plenty of victories in the budget that the council passed.

The city’s $516.6 million spending plan next year will include a total of $54 million to repair the city’s aging streets, including $34 million in new funding to begin replacing the worst of them.

Coleman’s 8-80 fund, a $42 million program to invest in such amenities as bike paths, green space and the Palace Theater, survived council scrutiny, as did his $200,000 parental leave initiative.

With the help of a 2.4 percent property tax levy increase, next year’s budget closes the city’s $9.6 million deficit. The City Council agreed with Coleman’s formula of $5.6 million in new revenues, including state aid and higher inspection fees, along with $4 million in spending cuts largely taken from vacated positions — but without any layoffs overall or reductions in sworn police and fire personnel.

The tax levy of $103.6 million equates to a $16 tax hike on a median-valued St. Paul home of $145,000, not counting tax increases due to property-value shifts and changes made by other taxing jurisdictions.

Using sales tax revenues that were higher than expected, the council agreed to spend $1.1 million on an additional ladder truck for the fire department and $300,000 for more library materials. It added $500,000 to repair the RiverCentre parking ramp, $50,000 to expand the Children’s Museum and $25,000 to help low-income families afford the city’s pools.

Coleman did approve of the City Council earmarking $55,000 for Sunday hours at the Merriam Park library, and he said that “in an ideal world your libraries would be open 24/7. But that’s not realistic.”

Lantry countered that the council found a way to expand library hours without raising the overall levy. It happened in three steps Wednesday.

First, council members, sitting as the Housing and Redevelopment Authority (HRA), voted 6-1 to transfer $345,000 from the HRA parking fund — made of up city parking ramp revenues — to the city’s general fund to pay for parking meter repairs and maintenance.

That, in turned, freed up $345,000 earmarked in the general fund for parking meter maintenance — which council members, sitting as the library board, voted 6-1 to use for additional evening hours twice a week at seven library branches.

Then council members, finally sitting as the City Council, approved the overall budget, which included the additional library funding.

“Keeping those libraries open is a lot more important to families … than investing in a few ugly parking lots,” Council Member Chris Tolbert said.

The lone dissenter was Council Member Dave Thune, who said the financing pretzel was disingenuous and robbed money from economic development projects in the city’s neighborhoods. “This is not a good way to do business, budget-wise,” he said. “It will come back to haunt us when we don’t have the money.”

Lantry said the parking fund still has left an unrestricted cash balance of more than $600,000, enough to keep the libraries open longer through 2017. But Coleman said that future budget challenges, fed by inflation and a likely decline in state aid, may wind up forcing the city to lay off library employees it will need to staff the additional hours.

“I hope my veto gives them the chance to rethink what will be the long-term challenges of their actions,” he said.