The name of the biggest loser in Tuesday’s election may not have even been on the ballot: As a result of the re-election of Gov. LePage and gains by Republicans in the Legislature, the city of Portland could face some tough budget years ahead.

Ever since he took office, the governor has had in his sights cuts to programs that have a profound effect on Portland’s city budget. He has repeatedly proposed cuts to General Assistance, a combined state and local responsibility, as well as to municipal revenue sharing.

For the last two years, the city has been insulated by Democrats who controlled both houses of the state Legislature and the presence of state Sen. Justin Alfond of Portland, who has been president of the Senate. Now the Senate is in Republican control, with LePage ally state Sen. Michael Thibodeau of Winterport as president. Democrats still control the House, but the margin is small.

The election map looked like a revolt of rural Maine, with the population center of Greater Portland largely going Democratic while the rest of the state went with the governor. The pattern was even more pronounced in the referendum to ban some bear hunting practices, which was soundly defeated north and west of Casco Bay.

What does that mean for Portland? It’s too soon to say for sure, but it’s a good bet that there will be less help from the state coming Portland’s way.

Even with the Legislature in Democratic control, the city lost about $2 million in revenue sharing between 2013 and 2014, dropping from $6.3 million to $4.3 million.

LePage calls the program, which returns a share of state taxes collected to cities and towns, “municipal welfare,” and during the campaign he proposed replacing it with a direct rebate payment to property owners. That would leave the city in the position of cutting services or raising taxes.

Portland is currently embroiled in a dispute with the state about its General Assistance program, which distributes about $9.6 million a year in aid, $7.2 million of which comes from the state. About 90 percent of the money is spent on housing assistance.

LePage has ordered the city to stop helping what he calls “illegal” immigrants, which, according to him, includes asylum seekers who are in the country legally and are engaged in a legal process of seeking permanent residency (even if, in some cases, their visas have expired). LePage has threatened that the city will get no part of the General Assistance budget if it doesn’t cut off these families. The matter is now before the courts.

If either or both of these programs are cut, people in Portland are going to have to set priorities at budget time. The city should not abandon its commitment to providing food and shelter for those with nowhere else to turn, or forget that property taxpayers have limits. These deliberations could easily get ugly.

The next two years will be a test for the whole community. Social service cuts would affect more than just the people who depend on the programs.

People who care about schools, public places and transportation will be needed to fight to keep state cuts from crowding out spending for other services. They could find support from property taxpayers, especially real estate developers and commercial property owners, who might be able to get the business-minded governor to listen.

Portlanders should resist the impulse to fight with one another. If the city is headed for difficult times, the troubles will be even tougher if people who should be working together are in conflict. The next two years are going to require people representing different interests to listen to each other, and recognize how much they really have in common.