NEWPORT NEWS, Va. — President Obama flew on Tuesday to the vast shipyard where the nation’s nuclear-powered aircraft carriers are built to send a warning that automatic cuts in the Pentagon budget, only three days away, threatened the jobs of tens of thousands of workers and America’s fragile economic recovery.

“This work, along with hundreds of thousands of jobs, are currently in jeopardy because of politics in Washington,” the president told a crowd of several hundred at Newport News Shipbuilding, which employs 21,000 people in Virginia and is the state’s largest industrial employer. “These cuts are wrong. They’re not smart. They are not fair. They are a self-inflicted wound that doesn’t have to happen.”

In a sign of the deepening intransigence on both sides, Republicans dismissed Mr. Obama’s remarks as political grandstanding and accused him of trying to scare Americans by exaggerating the impact of the cuts. They mocked Mr. Obama’s recent trips to sound alarms about the budget cuts as campaign-style events that would not ease the nation’s fiscal problems.

House Speaker John A. Boehner said the president was using the country’s “military men and women as a prop in yet another campaign rally,” and showed no willingness to accept Mr. Obama’s demands for more revenue by closing tax loopholes. “Spending is the problem, and spending cuts are the solution,” Mr. Boehner said on Capitol Hill. “Yes, we should close loopholes, but we should do it as part of tax reform that lowers rates and helps create jobs.”