As the country gears up for what may be one of the most acrimonious elections in American history, Democrats and Republicans appear unable to agree on anything — even federal spending for their own districts. At least, that’s what our new research suggests: Even local spending can be polarizing.

We looked at how voters responded to hundreds of billions of dollars that the 2009 economic stimulus package pumped into local economies. Economists agree that the stimulus helped cushion the economy during the Great Recession. Conventional wisdom would suggest that voters reward politicians for such an investment.

In fact, early in the first Obama administration, signs alongside highway road repairs proclaimed “Project Funded by the American Recovery and Reinvestment Act.” Sen. Judd Gregg, a Republican from New Hampshire, strongly opposed these, claiming, “These signs are simply for political self-interest, and it’s high time we stop using stimulus dollars to fund them.” Other Republicans were equally outraged and worried that Democrats could “claim political credit” if people saw tangible benefits from the federal government.

But it turns out that Republicans needn’t have worried. The stimulus did not simply boost Democrats’ popularity. Rather, it increased polarization. All else being equal, more stimulus money made blue places bluer and red places redder.

Here’s how we examined this.

In our study, we examine county support for the Democratic president — and how much that changed from 2008 to 2012, paying attention to whether the size of the stimulus package was correlated with the degree of change. Recall that the Democrats, on average, lost votes between the 2008 and 2012 elections. In the average county, support for Barack Obama dropped by three percentage points. So if losing three points was “par” for Obama in 2012, we see if stimulus spending predicts where the president under- or overperformed electorally.

What we found surprised us. More stimulus dollars helped the Democrats only in counties that were already heavily Democratic.

We estimate the impact of counties going from the 10th percentile of stimulus spending ($453 per capita in grants and loans) to the 90th percentile of stimulus spending ($2,230 per capita). In counties where Obama won 65 percent of the vote in 2008, this additional $1,777 per capita in stimulus spending is associated with a 0.44 percentage point bump in support for the president in the next election — and more in even more Democratic counties.

But in Republican counties — those that voted 80 percent or more for John McCain in 2008 — additional spending actually reduced support for Obama by similar margins.

For example, consider Rolette County in North Dakota, a Democratic district, and Eureka County in Nevada, a Republican district. Each received almost exactly $2,230 in per capita investment spending from the stimulus.

Citizens of Rolette County voted 75 percent for Obama in 2008; in 2012, Rolette supported Obama by only one percentage point less, or 74 percent, a smaller decrease than in most other counties.

But few citizens of Eureka County voted for Obama in 2008 — only 19 percent. And in 2012, only 13 percent of Eureka’s votes went to Obama — a six point drop, bigger than average.

On the other hand, consider Jackson County in Iowa, a Democratic district, and Wayne County in Tennessee, a Republican district. Both of these districts received about $438 in per capita investment spending, which places them in the bottom 10 percent of counties in per capita stimulus spending. Jackson County voted 61 percent for Obama in 2008 and reduced its support to 58 percent in 2012.

Only 25 percent of Tennessee’s Wayne County voted for Obama in 2008 and reduced its support to 21 percent in 2012.

To be more precise, in these two districts, support for Obama dropped 3.6 percentage points and 3.3 percentage points, respectively. In other words, both of these counties, despite their very different partisan profiles, reduced their support for Obama at comparable rates.

The more stimulus money a county got, the more polarized its voters became

We find that these four counties represent a broader trend. The more federal money went to heavily partisan counties, the further away they moved from each other in the 2012 presidential election. The same basic pattern held true in House races that year; the more money a county received, the more polarized the county became.

Why? One possibility is what political scientists call “elite polarization.” The stimulus legislation was highly partisan. In the House, only Democrats voted for the bill; in the Senate, only a handful of Republicans did. These polarized politicians, or partisan media in their districts, may have offered different interpretations of stimulus spending and its effects. Perhaps these conflicting explanations primed constituents to perceive projects in their communities as either good or bad.

So what does this tell us?

Our findings have troubling implications. Political science research has been finding increasingly polarized reactions to polling questions. For instance, two-thirds of Democrats surveyed approved of the stimulus, while three-quarters of Republicans disapproved.

But our work suggests that polarization is even deeper: The public, at least in this very high-profile instance, reacted to actual federal spending by growing more divided.

Sen. Gregg, Rep. Darrell Issa (R-Calif.) and others who objected to the highway signs should have indeed worried about the electoral impact of local stimulus spending — but not because the Democrats would benefit. Rather, apparently the stimulus further fragmented an already divided country.

Katherine Levine Einstein is an assistant professor of political science at Boston University.

Kris-Stella Trump is a research associate at IMPAQ International.

Vanessa Williamson, a fellow at the Brookings Institution, is the author, with Theda Skocpol, of “The Tea Party and the Remaking of Republican Conservatism.”