By Megan Cassella

WASHINGTON  (Reuters) -- President Barack Obama called for higher blue-collar wages and benefits and promoted collective bargaining on Wednesday, courting workers' unions as his advancing Pacific Rim trade deal has disenchanted many labor groups.

In a speech to workers, union leaders, lawmakers and employers, Obama supported the defense of workers' rights and urged workers to band together in an increasingly technology-driven sharing economy.

"I believe when people attack unions, they're attacking the middle class," Obama told attendees of the first-ever White House Summit on Worker Voice.

"We've got to make sure as we continue to move forward, both in this 'on-demand'economy and in the more traditional economy, that ... working Americans don't get lost in the shuffle," he said. "They can come together and they can win."

Obama pointed to companies like Lyft and Uber, ride-sharing services, and Handy and TaskRabbit, which help users outsource housekeeping and chores, as innovators that help increase workers' flexibility and autonomy.

But he cautioned that such companies, which are not unionized, could also be detrimental to workers.

"If the combination of globalization and automation undermines the capacity of the ordinary worker and the ordinary family to be able to support themselves ... then we're going to have problems," he said.

Obama and union leaders have recently been at odds, with the president advocating for a 12-nation Trans-Pacific Partnership that labor groups fear could destroy U.S. jobs. The pact was announced early Monday and is awaiting approval from Congress.

At the summit, Obama highlighted unions as a means to empower workers. He cited the website, which helps employees organize online, and the Fight for $15 movement, which successfully fought for a higher minimum wage for fast-food workers in New York and Los Angeles, as "good things happening in America."

Terrence Wise, a second-generation fast-food worker at both Burger King Corp and McDonald's Corp, introduced the president.

"I have seen firsthand how we are heard - and how we make change - when workers like us stick together," he said. "We are united as working people, as moms and dads, as proud Americans, to make sure all work pays what we need to support our families."

(Reporting by Megan Cassella; Editing by Richard Chang)