On June 6, 2006, Bilbray won a special election as representative for California's 50th congressional district to serve out the remaining seven months of the term of fellow Republican former Representative Randy "Duke" Cunningham, who resigned after pleading guilty to accepting $2.4 million in bribes. Bilbray won re-election in the November 2006 general election and represented the 50th district until decennial redistricting. Due to district realignment from decennial redistricting, he ran as the incumbent in the 52nd district in the 2012 general election, but lost to Democrat Scott Peters.

Bilbray became interested in politics when an extensive program of eminent domain was proposed for Imperial Beach. He ran successfully for the city council as a populist, serving during 1976–1978, and was mayor during 1978–1985.

The race to assume Cunningham's seat was highly contested, especially on the Republican side, with 14 Republicans (compared with only 2 Democrats) officially running for the position. Leading up to the initial all-candidate election that would determine the parties' candidates in a runoff election, Bilbray was in a virtual tie with Republican businessman Eric Roach,[6] slightly ahead of former State Assemblyman Howard Kaloogian. Four days before the election, businessman Alan Uke, one of the major Republican candidates, ran an attack ad accusing Roach of outsourcing thousands of jobs at the expense of American workers.[7] In the initial all-party special election on April 11, 2006, Bilbray was the Republican candidate with the most votes, receiving 15.26% of the total vote to Roach's 14.50%. He then faced the top vote getters of all the other parties in a runoff election on June 6, 2006: Democrat Francine Busby, Libertarian Paul King, and William Griffith, an independent.

During the campaign, Arizona Senator John McCain canceled a planned fundraiser for Bilbray at the last minute, after Bilbray called McCain's immigration bill "amnesty" for illegal immigrants.[8] McCain later contributed money to Bilbray's campaign and voiced a radio commercial for the National Republican Congressional Committee in support of Bilbray's race against Busby.[9]

Bilbray won the runoff with 49% of the vote, and was sworn in on June 13, 2006 as a member of the Congress. The Republican Party considered this a bellwether race because this district had "the perfect storm in favor of the Democrats" according to Ken Mehlman, the RNC Chairman at the time of the special election. The Democratic National Committee's Voting Rights Institute raised several concerns about the fairness and accuracy of the vote count.[10] An election contest lawsuit sought a hand recount.

However, Bilbray was sworn in before the vote count was official.[11] The court dismissed the suit on the basis that, once the House of Representatives had sworn in Bilbray, the court lacked jurisdiction to hear the challenge.[12]

Bilbray and Busby each won their party's primary, and faced each other again in the November general election. Bilbray defeated Busby by a margin of 54.2%-43.5%. Bilbray ran as an opponent of illegal immigration. With the advantage of incumbency and the Republican edge in registrations in the district, Bilbray was initially a clear favorite to win in November. Both the Cook Political Report and CQPolitics first rated the race as Republican Favored. But Busby gained in October, with a late-October poll by SurveyUSA showed Bilbray ahead by just 3 points, for a number of reasons: the general political climate seen as disadvantageous to the GOP, Busby's outraising Bilbray, and Bilbray's low profile campaign. On October 23, CQPolitics changed their rating to Leans Republican.[13]

Running unopposed in the June primary, Bilbray overcame a strong challenge from Democrat Nick Leibham in the November 2008 general election. With help from the DCCC[14] and $1 million in donations,[15] Leibham ran a string of TV attack ads against Bilbray. Democrats thought they had a chance at winning the district due to the hostile environment plaguing Republicans in general, and shifting demographics locally. Bilbray won, 50% to 46%, with 4% of the vote going to Libertarian candidate Wayne Dunlap.

Due to district realignment after the 2010 census, Bilbray ran as the incumbent in the 52nd congressional district in 2012. An all-parties primary was held on June 5, 2012. A runoff between Bilbray and current Port of San Diego Commissioner Scott Peters, a Democrat, was held on November 6. The initial vote was very close, so that a winner was not declared until ten days after the election as provisional ballots were counted. On November 16, with Peters ahead by 50.72% to 49.28%, Bilbray conceded defeat.[16]

Questions about Bilbray's residency again arose after his reelection on November 6, 2010, when he personally, as well as his children Briana and Patrick, claimed to not live in California and not qualify for in-state tuition in a class-action lawsuit against the University of California. Brian Bilbray appeared as a named plaintiff residing in Virginia.[18]

During the 109th Congress Bilbray served on the House Armed Services, Veterans Affairs and Government Reform Committees. During his first term Bilbray co-authored legislation that led to the transfer of the Mount Soledad Veteran's Memorial from the City of San Diego to the federal government. He also authored legislation that would have reformed the federal budget process.

Bilbray positioned himself as moderate on some social issues while conservative on immigration and fiscal matters.[19][20] He is a signer of the Taxpayer Protection Pledge.[21]

During his second run for Congress in the 50th district, Bilbray won over many of the district's most conservative voters with his hard line stance on illegal immigration. Since then Bilbray's voting record has been considerably more conservative than it was during his first term. He is a member of both the moderate Republican Main Street Partnership and the conservative Republican Study Committee, two groups with conflicting positions on policy. For example, the RMSP supports embryonic stem cell research and opposes the Federal Marriage Amendment, while the RSC opposes embryonic stem cell research and supports the FMA. He is also a member of Republicans for Choice.

Bilbray voted in agreement with President George W. Bush 93% of the time, and as a result was given a 93% Presidential Support Score by CQ Politics in 2006.[22]

In October 2011, Bilbray voted for a bill that would prohibit public funding for abortions. It passed 251-172 in the House. Bilbray almost always has voted for free trade agreements in the past years, specifically with Korea, Colombia, and Panama, all of which passed. The following month, he introduced a new bill which would benefit veterans. It provides job training and internships paid for by federal grants.[23]