In 2002, he ran for Florida's 112th state house district. He defeated Ray Gonzalez in the Republican primary, 52–48%. He won the general election unopposed. He won re-election unopposed in 2004, 2006, and 2008. In the Florida House, Rivera chaired the rules committee before serving as chairman of the appropriations committee from 2009 to 2010, where he pushed to create new professional schools at FIU and helped the Miami-Dade delegation work within a tight state budget. “We are all geared toward finding cost savings,” he explained to the Herald. Alongside his support for tax-free back-to-school shopping holidays, Rivera sponsored a measure forbidding places of higher education in Florida from sponsoring and paying for research trips to Cuba. And it was Cuba, perhaps more than any other issue that emerged as Rivera’s main issue concern in Tallahassee: “It’s the most important issue to me,” he said in the winter of 2004. “I think every Cuban American from whatever walk of life has a moral obligation to continue the cause of a free and Democratic Cuba. In addition to his legislative office, he has served the Republican Party as State Committeeman for the Republican Party of Florida and as the Executive Director for the Republican Party of Miami-Dade County.
U.S. House of Representatives
Elections
;2010 In January 2009, Rivera filed to run for the state senate seat being vacated by J. Alex Villalobos. However, when neighboring U.S. Congressman Lincoln Díaz-Balart decided not to run for another term in 2010, his brother, U.S. Congressman Mario Díaz-Balart, opted to run for a new term in Lincoln's district rather than his current one. This created an opening in the seat and prompted Rivera to announce he would run for Florida's 25th congressional district on February 25, 2010. On August 24, he won the Republican primary with 63% of the vote. On November 2, Rivera defeated Democratic nominee Joe Garcia 52%–43%. ;2012 Redistricting resulted in Rivera's district being renumbered as the 26th district. It lost its share of Collier County and picked up the Florida Keys, as well as portions of Miami-Dade County. While the old 25th leaned Republican, the new 26th is more of a swing district and is equally split between Democrats and Republicans. In a rematch from 2010, Garcia defeated Rivera 54%–43%.
In May 2014, Rivera announced he would run for Congress again. He was defeated in the Republican primary, coming in fourth place with 7.5% of the vote. In March 2016, David Rivera announced he would run for the open state house district 118, but lost to Democrat Robert Asencio by 53 votes. In March 2017, Rivera announced he would run for the state house again in 2018, this time in neighboring district 105.