Rep. Dave Brat applauds at a ribbon-cutting ceremony on Feb. 6 in front of the Spotsylvania Courthouse in Spotsylvania, Va. (Hilary Swift/AP)

When Congress voted repeatedly on short-term funding for the Department of Homeland Security this year, five Virginia Republicans were in firm opposition, part of a failed conservative attempt to halt President Obama’s executive order protecting millions of undocumented immigrants.

Call it the Dave Brat effect. His surprise primary victory last spring over former House Majority Leader Eric Cantor (R-Va.) not only created a power vacuum in Virginia’s delegation, it left Republican lawmakers from the commonwealth willing to buck their party’s leaders in order to avoid angering conservatives, Republican strategists say.

That fear reflects a division in the state party that has made fundraising difficult and forced the powerful speaker of the state House of Delegates into a primary.

It’s hard to find an exact parallel in past votes, especially because contentious bills are often yanked off the floor by GOP leadership to avoid an embarrassing failure. Still, Republicans on and off the Hill agree that Cantor would not have permitted a repeated mass defection, as happened with the DHS funding bill.

“Without Eric here, then one of the arm-twisters is silenced,” said Rep. Louie Gohmert (R-Tex.), an advocate for strict anti-immigration policies and one of the dozens of conservatives who demanded that any DHS funding bill also cut off support for Obama’s executive order.

On a vote to extend funding for the agency for three weeks that failed by a mere 11 votes, Reps. Brat, J. Randy Forbes, Robert Hurt, H. Morgan Griffith and Rob Wittman all cast “No” ballots, against the wishes of the Republican leadership.

They also voted early, not waiting to see whether their votes might be needed to tip the balance the other way. Later that night, all five voted against a one-week extension, which passed with 357 votes.

And when the House Republican leadership turned to Democrats to help pass a one-year funding plan with no strings attached, two more Virginian Republicans voted no: Bob Goodlatte and Scott Rigell.

Among Virginia Republicans, only Rep. Barbara Comstock voted in favor of all three bills. She was elected last fall from a moderate district that encompasses much of Fairfax County and includes tens of thousands of federal employees, among them the DHS workers at a large disaster-operations facility in Winchester.

Griffith comes from a deep-red district in southwest Virginia and has long worked to balance the desires of activists at home and leaders in Congress. Hurt and Forbes are in more marginally Republican seats in central Virginia, but both have taken heat from tea party activists. Wittman’s coastal district includes many federal workers but tends to be more conservative than Comstock’s.

For them and other Republicans, immigration is a particularly touchy issue. Brat’s accusations that Cantor supported amnesty for people who entered this country illegally helped fuel the newcomer’s upset victory.

Even out of office, Cantor made it clear where he stood before the DHS votes: In January, he warned Congress against “relitigating” Obama’s immigration moves.

Brat, in contrast, is a member of the new and aggressive House Freedom Caucus. A spokesman for Brat said “the delegation knew firsthand his stance on illegal immigration and the president’s unilateral amnesty, but you’d have to ask them why they voted the way they did.”

Gordon Neal, a spokesman for Wittman, said there was no direct link between his boss’s vote and Cantor’s ouster, noting that for several years, Wittman has opposed short-term budgetary fixes. Wittman co-sponsored a bill with two Virginia Democrats to ensure that DHS employees would continue to be paid during a government shutdown.

“It’s definitely a different feel” without the former majority leader, Neal said, but “Mr. Cantor being there didn’t necessarily force [Wittman] to do anything.”

Griffith said he voted no because he thought the House should work out its own solution to the funding impasse rather than adopt a Senate plan that did not touch on immigration policy. He had individual conversations on the issue with other Virginia members, he said, but there was no group discussion.

When Cantor was in office, Griffith said, he “may have called the delegation in and said, ‘Hey, I really need your vote on this.’ ” With him out of Congress, there was no member of the Virginia delegation willing or in a position to lobby like that on behalf of party leaders.

Instead, Republicans say, Brat’s very presence is a reminder to Virginia’s GOP lawmakers of what can happen to members who stray from conservative priorities.

“When Cantor lost, for them, it got real,” said James Parmelee, executive director of the Northern Virginia Republican PAC. “You never know which vote or which series of votes are going to be the ones to spark a primary challenge.”

State lawmakers are feeling the same pressure: Virginia House Speaker William J. Howell (R-Stafford) faces a primary challenge over his support for a landmark transportation deal that raised taxes.

A highway funding bill due for a vote in two months could show whether the recent DHS votes were an unusual confluence of opinion or a sign of a delegation moving right. So could the re­authorization of the Export- ­Import Bank. Homeland Security funding is scheduled for another vote this summer, this time for the 2016 fiscal year.