The US Senate on Monday passed a bill aimed at ending tax-free shopping on the internet but the move looks set to face fierce opposition before it becomes law.

The Marketplace Fairness Act, which has cross-party supporter and the backing of powerful retailers, would give states the power to require retailers with sales over $1m to collect state and local sales taxes for online purchases.

The bill has the support of president Barack Obama the majority of senators including Republican John McCain but Marco Rubio, seen a potential Republican presidential hopeful, and Rand Paul both voted against the bill.

The bill passed the Senate by 70 votes to 24 but faces a second test in the House of Representatives where internet retailers and conservatives are already lobbying against the tax. House leaders have yet to schedule hearings or votes on their version of the measure.

The legislation would overturn a 1992 supreme court ruling that said a state could not force a retailer to collect sales tax unless the retailer had a physical presence in the state.

The bill has aligned unlikely parties. Amazon, the largest online retailer, has joined its bricks-and-mortar rivals including Walmart to support the act. Amazon was once a staunch critic of the tax but as it has built more distribution centers it has become liable for sales tax in more states and is now a backer.

The largest online opponent is eBay, which has campaigned against the bill and organised a mass protest by its sellers. Other opponents include numerous conservative and antitax groups including Americans for Tax Reform, FreedomWorks and Heritage Action.

Ahead of the vote the National Retail Federation called for Congress to "level the playing field" and tax online retailers. "The Marketplace Fairness Act is a commonsense piece of legislation necessary to modernize and streamline our federal and state understanding of sales tax laws so that they can keep current with real world change in the marketplace," said NRF senior vice president David French.

"As the retail industry evolves and digital commerce becomes a more prominent portion of total retail sales, it is critical that the tax laws not discriminate between businesses based on how their products are distributed," French said.

"This collection disparity has tilted the competitive landscape against local stores, creating a crisis for brick-and-mortar retailers around the country and in your state," French said.