WASHINGTON — The House speaker, John A. Boehner, said Sunday that he was “certainly” prepared to allow funding for the Department of Homeland Security to lapse, raising the possibility that one of the government’s largest and most vital agencies could be shut down at the end of the month.

Coming just two months after Republicans gained full control of Congress, a shutdown would be a major political problem as the party tries to honor a vow to govern responsibly and cooperatively.

It would contradict a pledge from Senator Mitch McConnell of Kentucky, the majority leader, who said the day after his party won decisively at the polls in November, “There will be no government shutdowns.” And it would exacerbate a rift that has been growing between Republicans in the House and the Senate.

“The House has done its job; we’ve spoken,” Mr. Boehner said on “Fox News Sunday.” “If the Senate doesn’t like it, they’ll have to produce something that fits their institution.”