WASHINGTON -- President Barack Obama on Friday officially endorsed Rep. Pete Stark (D-Calif.), the 20-term veteran of Congress who is facing a surprisingly competitive race in California's newly drawn 15th District.

"Congressman Pete Stark is a tireless champion for all of the 15th's working families," said the president in a statement. "We've worked hard these last three years to bring meaningful, positive change to our nation -- fighting for good jobs, good schools and a health care system that works for all of our citizens. We have made great strides, but there is much more to do. That is why we need his dedicated efforts back in Congress to continue the fight with me. I need you to cast your vote for Congressman Stark in the June 5th Democratic Congressional Primary."

Stark, an irascible liberal icon, is facing a tough primary race after redistricting coupled with a string of campaign gaffes have left him vulnerable to the attacks of his relatively unknown competitor, Eric Swalwell.

Stark has made a series of confounding assertions and unsubstantiated charges in recent weeks, drawing headlines when he confused failed solar energy company Solyndra with the electric car company Tesla. "I wish I had enough expense allowance to get one of those new S's that Solyndra's going to make down there -- the electric car," he told editors at the San Francisco Chronicle. "They run $60,000 to $90,000."

But in his statement Friday, President Obama defended Stark, praising him for his experience and efficacy. "We cannot have a return to failed policies of the past. Congressman Stark has worked closely with me on crucial programs and policies that have made a real difference not only in California, but across America. We need his wisdom, experience and his steady, 'get-things-done' style now more than ever," Obama said.

Stark, the ranking member of the House Ways and Means health subcommittee, is a staunch medical marijuana defender who has opposed America's involvement in ill-conceived wars, come down hard on irresponsible financial institutions, supported health care reform and a slew of other social programs, and fought for the poor.

"I am honored to receive the President's endorsement," Stark said in his own statement Friday. "After a campaign focused on health care, working families and economic development, my first task back in Congress will be to work with the President and other members of Congress to get our economy back on the right track."

Stark, an Air Force veteran, was a banker before defeating a 14-term incumbent for his House seat in 1972 on an anti-Vietnam War platform. Now California's longest-serving member, he is also Congress' only avowed atheist.

A son from his first marriage is an Alameda County deputy district attorney. He also has a 16-year-old son and 10-year-old twins from his current marriage.

In all his years in office, Stark, 80, has had only one primary challenger, whom he beat resoundingly with 84 percent of the vote. But significant redistricting after the latest census and a new state primary system that sends the two candidates with the most votes into the November general election, whatever their political party, has placed Stark's seat in danger.

The Chronicle video below documents some of the gaffes that could also be spelling trouble for Stark.