WASHINGTON (MarketWatch) -- A Democrat bill aimed at discouraging outsourcing of U.S. jobs failed a key test vote in the Senate on Tuesday, in a legislative defeat for President Barack Obama’s party just weeks before the congressional midterm elections.

Sponsors of the bill couldn’t muster the 60 votes needed to cut off debate on the measure, which includes a payroll tax break for companies that move jobs to the U.S. from overseas.

The vote was 53-45.

Four democrats, including Senate Finance Committee Chairman Max Baucus of Montana, joined Republicans and Connecticut independent Joe Lieberman in blocking the bill.

AM Report: Outsourcing Rises as Key Campaign Issue

Republicans and business groups said the bill would make American companies less competitive. Democrats said the measure was a powerful incentive to keep jobs on U.S. shores.

“This is a fight about whether or not we’re going to make things in America,” said Sen. Debbie Stabenow, a Michigan Democrat. “We can’t have a middle class...if we don’t make things.”

Republicans derided the measure as an election-year ploy by Democrats.

“This bill is not a serious attempt to address a problem,” said Senate Republican Leader Mitch McConnell on Tuesday. “It’s a purely political exercise aimed at making a good impression.”

Business groups including the U.S. Chamber of Commerce and the National Association of Manufacturers opposed the bill, saying it wouldn’t make American companies more competitive or stimulate economic growth.

The bill would also end subsidies for companies that move facilities abroad.

Outsourcing has become an issue in political campaigns including the California Senate race, where Democratic incumbent Sen. Barbara Boxer is criticizing her Republican opponent Carly Fiorina in a TV ad for moving jobs abroad when she was chief executive of Hewlett-Packard Co.

In Pennsylvania, Rep. Joe Sestak charges that his opponent in that state’s Senate race has “consistently supported large corporations that drain opportunities at home in favor of bigger profits overseas.” Republican Pat Toomey, a former House member and president of the Club for Growth, is leading Sestak by 6.5 percentage points in the latest average of polls from RealClearPolitics.

Republicans argue that corporate and other tax rates should be cut to encourage competitiveness.

But the bigger tax debate has stalled for now. The Senate has delayed a vote on extending tax cuts passed during the Bush administration until after the Nov. 2 elections.