David Rivera, right, is Cuban American like Sen. Marco Rubio. (Alan Diaz/AP)

As an underdog candidate for the U.S. Senate going nowhere in the polls, Marco Rubio thought about dropping out. Then his close friend David Rivera showed up at his house, armed with giant sticky notes to paste reasons not to quit all over Rubio’s living room.

But now, as Rubio pursues another audacious, uphill campaign, this time for the Republican presidential nomination, the man he has called his “most loyal friend and supporter” could be a big political problem.

That’s because Rivera — a fellow South Florida pol who won a U.S. House seat in 2010, the year of Rubio’s come-from-behind Senate victory — has left politics under an ethics cloud.

Rivera, who failed to win reelection, has been a target of state and federal investigations looking into his alleged failure to disclose income as well as his alleged role in support of a 2012 shadow campaign designed to undercut his chief Democratic rival for Congress.

Rivera has never been charged with a crime and has said he did nothing wrong. But the revelations have been embarrassing. A former girlfriend, for instance,told prosecutors that Rivera recruited her to help with the shadow campaign and then helped her flee to Nicaragua — allegations denied by Rivera.

David Rivera, seen in 2010, has been a target of state and federal investigations, although he has not been charged with any crime. (Alan Diaz/AP)

Last month, a Florida ethics commission slapped Rivera with a $58,000 fine for routinely billing the state for travel and other expenses while paying himself back out of campaign accounts when he was a state legislator.

Rubio, meanwhile, has begun to gain traction as a White House contender. Since announcing his candidacy last month, he has been a consistent presence in polls near the top of the GOP pack.

So far, Rubio has largely stood by Rivera. But, as the campaign grows heated and rivals begin to take aim at his potential weaknesses, Rubio may face a quandary: whether to minimize his ties with a potential liability or remain true to his best friend in politics.

At the moment, Rubio and Rivera are linked on paper through their joint ownership of a home in Florida’s capital, Tallahassee. The house has been a cause for embarrassment, with Rubio and Rivera having been served with a foreclosure notice in 2010 after failing to make mortgage payments.

They put the house on the market for $125,000 a few weeks before Rubio’s formal campaign announcement, a move first reported by Politico. It has not yet sold.

Rubio declined through a spokesman to be interviewed. The spokesman, Alex Burgos, said that Rubio’s team knows that opponents will bring up the relationship but that they are comfortable there is nothing for Rubio to be concerned about.

Sen. Marco Rubio, who's running for president in 2016, is known for his stances on immigration and tax reform. Here's the Florida Republican's take on Obamacare, the Islamic State and more, in his own words. (Julie Percha/The Washington Post)

“David Rivera is an old friend of Senator Rubio’s,” Burgos said. “His hope is that Mr. Rivera can put his recent troubles behind him and go on with his life.”

‘Benefit of the doubt’

In 2012, when GOP nominee Mitt Romney was considering Rubio as a possible running mate, Rubio did not cast aside Rivera — even though Rivera, according to news reports, had already been under federal investigation for alleged tax improprieties. Rubio hosted a fundraiser for Rivera that year.

“I guess it’s because I’m new to Washington, but I’ve never felt it — I mean, maybe it’s acceptable here — it isn’t to me — to turn your back on friends when they’re going through a difficult time, no matter, you know, what they may have done or not done,” Rubio told Fox News. “He’s a friend, and I’m going to give him the benefit of the doubt.”

Rivera, in a recent e-mail exchange with The Washington Post, said the two remain in touch.

“We’re friends,” Rivera said. As for how often they speak, he added: “Depends on the month.”

Asked why Rubio has stood by him, Rivera was incredulous.

“Why wouldn’t he?” Rivera wrote. “After all, no federal government agency has ever said I was under investigation for anything.”

Some who are close to Rubio say they see no reason that the friendship would be relevant in a political campaign.

“My feeling on it is, whatever it is the authorities are looking at has nothing to do with Senator Rubio,” said former Florida GOP chairman Al Cardenas, who has known the two men since the 1990s. “That was just not his sphere of knowledge or control when it came to Rivera. I’m sure Rubio is as saddened as I am by what’s happened.”

Dan Gelber, a former Democratic leader of the state House of Representatives who worked with Rubio and Rivera as fellow members of the Miami delegation, said Rivera’s troubles are “wholly unrelated to Marco.”

But already, American Bridge, a Democratic group raising money for researching ads in the presidential race, has signaled that it intends to highlight the Rubio-Rivera relationship as part of a broader strategy to raise doubts about Rubio’s ethics. The group has also pointed to past criticism of Rubio for using a state GOP credit card to pay for personal expenses.

“It’s hard to imagine a world where Marco Rubio does not know the inner workings of David Rivera,” said Christian Ulvert, a Democratic strategist who once worked with Rivera on a campaign to bring slot machines to Miami-Dade County. “Because David Rivera sure knows the inner workings of Marco Rubio.”

The connection dates to the gen­esis of Rubio’s political career.

The two met as volunteers on Lincoln Diaz-Balart’s successful 1992 congressional campaign, and, four years later, Rivera recruited Rubio to work on Bob Dole’s presidential campaign.

Rivera, who was born in New York to Cuban immigrant parents, moved to Miami with his family when he was 9. By the time he was 14, he had volunteered for Youth for Reagan. After college, he worked for U.S. Sen. Connie Mack III (R-Fla.) and, at 24, landed a gig in 1990 as executive director of the Miami-Dade County Republican Party.

After Rubio and Rivera worked together on the Dole campaign, their own political aspirations quickly became known. Rubio ran for the West Miami City Commission and then the state House with financial and strategic support from Rivera. In 2002, Rubio, who had been elected to the Florida House two years earlier, helped Rivera with his own successful state House bid.

In Tallahassee, they were inseparable.

“There were always two phrases to define them,” Ulvert said. “Batman and Robin, and good cop and bad cop. Marco was always out front trying to be friendly, and David Rivera was always behind the scenes doing the heavy lifting.”

It worked well for them. Rubio, with his boyish good looks, lofty ideas and good-natured humor, made friends easily. And while some colleagues have described Rivera as charming in his own way, he has always seemed a better fit for a sidekick role.

Former colleagues say the dynamic helped propel Rubio’s rise through the House.

When Rubio ran for the speakership, Rivera traveled the state making the hard sell to fellow lawmakers. According to “The Rise of Marco Rubio,” by Post reporter Manuel Roig-Franzia, Rivera once surprised a group of legislators by pulling out pledge cards and demanding that they sign them. The lawmakers knew that the wrath of Rivera, with his behind-the-scenes power, could affect their own future elections.

One former House colleague, Republican J.C. Planas, now a Miami lawyer, said he personally felt Rivera’s heat when he stepped out of line.

Planas said that when he would not sign on to support Rubio’s chosen successor for the job — speakers are typically anointed years in advance — Rivera personally recruited a candidate to challenge him in the next GOP primary.

He wasn’t the only legislator to recall being on the other side of Rivera’s efforts. Alex Villalobos, a Miami Republican who once had designs on the top slot in the state Senate, said that when he didn’t vote the way Rubio and Rivera wanted on an amendment involving school class sizes, they tried to engineer his defeat at the polls.

“They raised $8 million to take me out,” Villalobos said. “I got fired as majority leader, I got stripped of my office and ended up in a little office down the hall.”

The most insulting part, Villalobos said, was showing up at his polling precinct with his 15-year-old daughter to find Rivera there to whip votes against him.

“He’s a real a------,” Villalobos said.

Rivera did not respond to questions about the recollections from Planas and Villalobos.

In 2010, Rubio and Rivera both set their sights on Washington. Rivera ran for the U.S. House, but he also played a pivotal role in Rubio’s Senate campaign — stepping in to talk Rubio out of shifting gears and running instead for state attorney general.

That was when Rivera came with a group of friends and a sticky pad to Rubio’s house. Together, they brainstormed reasons that Rubio should run for Senate — and Rivera plastered those reasons all over the living room.

Rubio wrote in his 2012 memoir, “An American Son,” that part of the reason he stayed in was that he didn’t want to lose the respect of these friends. Back when Rubio had run for speaker, he said Rivera had “done more for my candidacy than anyone else.” Rivera clearly was playing a pivotal role again.

Increased scrutiny

Rivera’s hard-fought congressional race in 2010 brought heightened scrutiny to his own political machinations. That year, local news organizations reported details of a 2002 highway collision in which Rivera ran his car into a truck carrying campaign fliers printed by his political opponent. Rivera said he was simply trying to pull the truck over to retrieve some of his own campaign literature. The crash delayed the truck from getting to the post office before it closed for the day.

In 2012, the Miami Herald reported that state law enforcement investigators had examined Rivera’s campaign spending practices and that, as a result, his arrest once seemed “all but certain.” Miami-Dade prosecutors had written a “draft” complaint that contained 52 counts of theft, money laundering and racketeering, the Herald report said. But after Rivera and his attorneys fought back, officials never charged him, citing among other things “statute-of-limitations issues.”

Later, Rivera was named as a co-conspirator in a scheme to prop up a shadow candidate in the 2012 Democratic primary to undermine the chief challenger for his House seat. Rivera ultimately lost the general election to that rival. In testimony this year, Rivera’s former girlfriend Ana Alliegro told a federal grand jury that Rivera used her to supply more than $81,000 to fund the operation, helped plot a coverup and then helped her flee to Nicaragua to avoid arrest.

Rivera said via e-mail that Alliegro’s allegations were “false.” He blamed “media hype” for the attention over the years paid to his alleged ethical problems.

Rubio’s relationship with Rivera was a point of concern for some members of Romney’s team as they vetted the senator for a possible vice-presidential nomination in 2012. According to “Collision 2012,” by The Post’s Dan Balz, some Romney aides worried that an indictment of Rivera in the throes of the campaign could become a major distraction. In the end, the Romney team determined that Rivera’s issues were unrelated to Rubio, and it included him on the short list — although the deliberations took place before the 2012 shadow campaign allegations against Rivera.

Matt Rhodes, Romney’s campaign manager, said that Rubio was “thoroughly vetted for vice president” and that the campaign was “confident that, if chosen, his legislative record and high personal character would have been a great asset to Mitt on the campaign trail and in office.”

Those close to Rubio say that not only should the senator not be punished for his loyalty but that he also deserves credit for standing by his friend.

“Would you stab a friend in the back?” asked Nelson Diaz, who said that as the Miami-Dade County GOP chairman he is remaining neutral through the presidential primary campaign. “I’ve stood by David, too. If he wants to go to the gates of hell, I’ll go with him. If Marco wants to go for the presidency, I’ll go with him. It’s a test of friendship more than anything else.”