WASHINGTON (AP) — Americans have a dismal view of Congress, yet Republicans are widely expected to keep control of the House of Representatives in the November election. That's not just a reflection of President Barack Obama's own diminishing popularity. It's largely the result of a shrewd Republican strategy that has tilted the electoral playing field in the party's favor.

That strategy goes back to the 2010 election, when Republicans rode a wave of dissatisfaction with Obama to capture the House. Less noticed, but perhaps more important, they aggressively sought — and won — control of legislatures in crucial states.

State legislatures don't often affect national politics. But once a decade, after the U.S. census, most are involved in redrawing their states' congressional districts. By taking control of key legislatures right after the 2010 census, Republicans were able to shape congressional maps in their favor. They spread out Republican voters to increase their chances of winning more seats, while packing as many Democratic voters as possible into the fewest districts.

The upshot is that independent experts give Democrats little chance to retake the House this year. That means Republicans will continue to have powerful leverage to block Obama's second-term agenda on issues including immigration and gun control. That agenda is further threatened by the Republicans' solid prospects for capturing the Senate. That chamber is not affected by redistricting because senators are elected in statewide votes.

The practice of manipulating congressional districts for political gain, known as gerrymandering, has a long history in the United States. It has been pursued enthusiastically by both Democrats and Republicans. But the Republican Party's success at it this decade has been historic: In 2012, Republicans achieved a 33-seat majority in the House, even though the party's candidates as a group got 1.4 million fewer votes than their Democratic opponents.

This year, the gerrymandering gives Republicans a big edge at a time they face a mixed political picture. Obama's approval ratings are at their lowest level and, historically, the party of the president tends to lose seats in midterm elections. But Americans are divided over which political party they would rather see win control of Congress, which has had approval ratings below 20 percent for the past year, according to AP-GfK polling.

How did Republicans gain their districting advantage? It started with a plan called REDMAP.

At its core were the changes stemming from the 2010 census. The census figures on state populations determine how many seats in the 435-member House each state will have. Then it's usually up to legislatures and governors to divide up the seats within their states.

REDMAP, which stands for Redistricting Majority Project, targeted races in states that were expected to gain or lose congressional seats as a result of the census. Republicans spent more than $30 million through REDMAP to help elect legislative majorities in important states like Ohio, Michigan and North Carolina, said Chris Jankowski, former president of the Republican State Leadership Committee.

Most of the 50 U.S. states have two legislative chambers. Before the 2010 election, Republicans had majorities in 36 state legislative bodies. Afterward, the party controlled 56, according to the National Conference of State Legislatures. In almost half the states, Republicans won control of the entire redistricting process.

In all, Republicans controlled the process of drawing the boundaries for 210 House districts, compared to just 44 districts for Democrats, according to statistics compiled by Justin Levitt, a law professor and redistricting expert at Loyola Law School in Los Angeles. The rest were drawn by divided government, the courts, or in a handful of mostly western states, independent commissions.

"I think Democrats made a terrible mistake. They did not put nearly enough attention or resources into legislative races at the state level," said Matt Bennett, a former aide to President Bill Clinton.

The gerrymandering strategy helped Republicans keep control of the House in 2012 even though Obama's sweeping re-election victory showed the nation as a whole leaning Democratic. It was only the second time since World War II that the party receiving the most votes failed to win a majority of House seats, according to statistics compiled by the House Clerk. Democrats gained eight seats but were still a minority.

Geography has helped Republicans in some states. Democratic voters are more likely to live in densely populated urban areas, making it easier to pack them into fewer districts.

The Republican advantage in House districts was evident in the 2012 presidential election. Obama received nearly 5 million more votes than Republican Mitt Romney. But in some states, large numbers of Obama's votes were packed into heavily Democratic congressional districts. As a result, Romney won 17 more House districts than Obama.

Ohio, Michigan, Pennsylvania, Virginia, Wisconsin and Florida accounted for the entire disparity. Obama won the statewide vote but Romney won the most congressional districts in each state.

Lopsided districts help explain why Congress is so polarized. The divide is reflected in demographic differences, which can shape the debate on a variety of issues. On immigration, for example, the average Democratic district has about twice as many Hispanic residents as the typical Republican district. This helps explain why House Republicans have less incentive to pass an immigration bill that would provide a path to citizenship for millions of people living in the U.S. illegally.

Rep. Steve Israel, who is in charge of the House Democrats' campaign operation, rejects arguments that Democrats can't win the House, regardless of the map. Jankowski, on the other hand, expects Republican candidates to continue enjoying the fruits of redistricting.

Still, Jankowski notes that people move and populations change. As the decade wears on, the political benefits will diminish and another redistricting battle will loom.

___

Associated Press senior research coordinator Cliff Maceda contributed to this report.

___

Follow Stephen Ohlemacher on Twitter at http://twitter.com/stephenatap