LOS ANGELES — President Obama on Thursday called for Congress to strip away tax advantages that have encouraged a rush of mergers and acquisitions that give companies an overseas base while they maintain their presence in the United States.

In an appearance at a technical college that was intended to focus on job training, the president used unusually harsh language to describe American companies that acquire overseas companies to relocate for tax reasons, known as inversions. He said they were renouncing their American citizenship by “cherry-picking” the nation’s tax laws at the expense of ordinary taxpayers.

“These companies are cherry-picking the rules, and it damages the country’s finances,” Mr. Obama said. “It adds to the deficit. It sticks you with the tab to make up for what they are stashing offshore.”

“I don’t care if it’s legal — it’s wrong,” he said, prompting the audience to boo the companies taking advantage of the practice.