In its struggle against surging online retailers such as Amazon.com Inc., Walmart Stores has unleashed a weapon long shunned by Sam Walton: lobbying.

On Tuesday, the House Judiciary Committee will hold a hearing on a bill to let states collect sales tax from out-of-state merchants that sell to their residents. If it is passed, online retailers, which now mostly don’t collect sales tax, will lose a price advantage that has helped them take business from brick-and-mortar stores.

Walmart, which has been boosting political contributions and staffing up its Washington office, is one of the prime movers behind the bill, said Rep. Steve Womack, an Arkansas Republican who authored the proposed legislation.

“This is Walmart’s top issue, if not one of their top issues,” Womack said in a phone interview. “Walmart is important to me because they are headquartered in my district.”

It’s easy to see why Walmart is determined to force online merchants to charge sales tax. Last year, Seattle-based Amazon’s sales grew 41 percent to $48.1 billion. Bentonville, Ark.- based Walmart increased U.S. sales at its namesake stores 1.5 percent to $264.2 billion. Five years ago, only about a quarter of Walmart customers shopped at Amazon, according to Kantar Retail, a London-based research firm. Now half say they do, Kantar says.

To improve its Web sales operations, Walmart has been acquiring social-media companies and technology firms in Silicon Valley. Walmart generates less than 2 percent of its revenue online, according to a Kantar estimate.

In the meantime, Walmart has been stepping up its Washington activities. The chain spent $7.8 million on lobbying efforts in 2011, the most in its history, according to OpenSecrets.org, a website founded by the Center for Responsive Politics, a watchdog group in Washington.

Before the mid-2000s, Walmart had a limited presence in the nation’s capital. The Washington office now has 15 people. .

Founder Walton preferred to steer clear of politics and focus on opening stores, according to Rogan Kersh, a political science professor at Wake Forest University in Winston-Salem, N.C., who studies corporate lobbying.