Rep. Greg Gianforte found himself in the Republican minority on Wednesday when voting for a bill aimed at border security and immigration reform, a measure supported by GOP leadership but killed by conservative members of the party's caucus.

Kathleen Williams, who's challenging Gianforte for the state's only seat in the House of Representatives, blasted Congress' failure to resolve the issue.

The bill voted on Wednesday would have changed the immigration system and generally adhered to President Donald Trump's requests for an overhaul. Still, the bill failed on a 301-121 vote, with Gianforte voting in the minority.

“I regret the House did not pass the immigration reforms I voted for that would begin the process of securing the border, building the wall, fixing our broken immigration system, and ending the practice of separating children from their parents,” Gianforte said Thursday in a statement provided to the Missoula Current. “I appreciate President Trump’s support of the legislation, and will continue working to find a solution that secures the border, reforms the system, and keeps families together.”

Despite a last-minute plea by the president, which came via Twitter in all caps, the House rejected the bill, with nearly half of Republicans opposing the measure.

The failed bill, seen as an attempt at compromise between the GOP's divided caucus, would have provided $25 billion for border security, including funding for Trump's wall. It also would have kept families together at the border and provided a path to citizenship for those under the DACA program, or Deferred Action for Childhood Arrivals.

“America’s borders have been too open for too long,” Gianforte said. “Drug cartels, dangerous gangs, and human traffickers exploit our weak borders and bring crime to our communities.”

Through a spokesperson, Williams on Thursday said Congress must work to secure the border and reform the system without disrupting families. Williams was on the road campaigning and not available to discuss her deeper views on immigration or what she'd do to resolve the issue.

"After more than a year in office, Greg Gianforte and this broken Congress have repeatedly failed to find bipartisan, commonsense solutions that would fix our immigration system,” Williams spokesperson Neal Ullman said.

“Kathleen has a proven record of reaching across the aisle to get things done for Montanans, and that's the experience she'll bring to Washington so that we can secure our borders, reform America's dysfunctional immigration system, and keep families together."