WASHINGTON (AP) — The House has voted to prevent a government shutdown.

New Republican Speaker Mike Johnson was forced to reach across the aisle to Democrats when hard-right conservatives revolted against his plan to keep the government funded into the new year.

Johnson was willing to leave his right flank Republicans behind and work with Democrats on Tuesday to keep the government open.

It’s the same political move that cost Kevin McCarthy, the former House speaker, his job.

This time, Johnson appears on track for a better outcome.

The Senate would act next, ahead of Friday’s shutdown deadline.

But Johnson is facing the same political problem that led to McCarthy’s ouster as hard-right conservatives oppose his leadership.

That could spell trouble ahead when funding runs out again in January