WASHINGTON — The House approved a stopgap spending bill on Thursday night to keep the government open past Friday, but Senate Democrats — angered by President Trump’s vulgar aspersions and a lack of progress on a broader budget and immigration deal — appeared ready to block the measure.

The House approved the measure 230 to 197, despite conflicting signals by President Trump sent throughout the day and a threatened rebellion from conservatives that ended up fizzling. But the bill, which would keep the government open through Feb. 16, provided only a faint glimmer of hope that a crisis could be averted before funding expires at midnight on Friday.

In the Senate, at least about a dozen Democratic votes would be needed to approve the measure, and there was little chance that those would materialize. Democrats are intent on securing concessions that would, among other things, protect from deportation young immigrants brought to the country illegally as children, increase domestic spending, aid Puerto Rico and bolster the government’s response to the opioid crisis.

The Senate held only a procedural vote on the stopgap bill late Thursday night, leaving for Friday a more consequential vote when Democrats are expected to block the measure.