WASHINGTON — President Obama on Tuesday flatly dismissed a short-term Republican plan to keep the federal government operating past Friday as Speaker John A. Boehner sought deeper spending cuts, putting Congress and the White House on a course toward a government shutdown.

Showing some exasperation at the impasse over this year’s budget, Mr. Obama appeared at an impromptu White House news conference and said it would be inexcusable if federal agencies were forced to shut their doors beginning Saturday because House Republicans and Senate Democrats could not bridge differences over a relatively small slice of the budget.

“As I’ve said before, we have now matched the number that the speaker originally sought,” the president said. “The only question is whether politics or ideology are going to get in the way of preventing a government shutdown.”

Appearing before television cameras in the Capitol shortly after the president spoke, Mr. Boehner seemed equally determined not to give ground. The speaker, who faces intense pressure from his conservative rank-and-file, said he intended to push for the greatest spending cuts achievable and would not be maneuvered by Democrats into settling for less.