WASHINGTON — Panicked Democrats locked in tight midterm races as the party tries desperately to hold onto control of the Senate fear President Obama’s anticipated executive amnesty for about 5 million illegal immigrants may doom their re-election campaigns.

New Hampshire U.S. Sen. Jeanne Shaheen, who has seen her double-digit lead in the polls evaporate into a virtual dead heat with former Bay State U.S. Sen. Scott Brown, said any such move should be left up to Congress.

Shaheen “would not support a piecemeal approach issued by executive order,” said her spokesman Shripal Shah, adding the Granite State incumbent “believes Congress must address our broken immigration system with a comprehensive fix.”

Shaheen, who had previously voiced a wait-and-see approach to the impending executive action from the president, joins a number of at-risk Democrats who are urging the president to leave immigration reform to lawmakers.

“The only conceivable explanation for the president to take such an unprecedented and drastic action would be that he has already conceded the Democrats’ Senate majority,” said National Republican Senatorial Committee spokesman Brad Dayspring. “Executive amnesty would be the political equivalent of nuclear explosion for Democratic candidates like Mary Landrieu (D-La.), Kay Hagan (D-N.C.), Mark Pryor (D-Ark.) and Jeanne Shaheen.”

Obama has vowed to take some form of executive action to address the nation’s immigration crisis and it could come as early as this week. Lawmakers failed to send immigration legislation addressing the immigration crisis, including a recent flood of 57,000 unaccompanied minors from Central American countries, before summer recess.

Brown, who released an ad last month hitting Shaheen on immigration, blasted the president’s plan to potentially grant “amnesty to millions of people.” But with Republicans needing only six pickups to reclaim control of the Senate, the president could be making a dangerous political gamble, experts said.

“Voters are on the other side of Obama, especially when it comes to amnesty,” said Washington-based Republican strategist Ron Bonjean. “Should Obama move forward with an executive order before the November election, it would be obvious that he cares more about his long-term legacy over the interests of his Democratic colleagues.”

Immigration advocates said congressional gridlock has forced the president’s hand. Obama has yet to release details about his impending executive action, but he has been considering a number of options that could grant temporary legal protection from deportation — on the basis of family relationships with citizens, length of residency or employment — to as many as 5 million people residing in the country without permission.

“We have seen too many stories of grandmothers of U.S. citizen children, who have lived here for decades, being deported,” said Kamal Essaheb, immigration policy attorney for the National Immigration Law Center in Washington. “Billions of dollars of resources are being thrown away to deport, literally, a thousand people a day.”