WASHINGTON – When Barack Obama was elected to the Senate in 2004, he received a congratulatory note from the top Republican on the Senate Foreign Relations Committee.

Richard Lugar's outreach to the up-and-coming Democrat helped give Obama the foreign relations credentials he needed to boost his future presidential bid. But Lugar's willingness to work with Obama contributed to the Indiana senator's 2012 primary defeat by a Tea Party Republican.

As the announcement of Lugar's death Sunday prompted an outpouring of praise for his career, one tribute stood out.

"In Dick, I saw someone who wasn’t a Republican or Democrat first, but a problem-solver," Obama said in a statement, "an example of the impact a public servant can make by eschewing partisan divisiveness to instead focus on common ground."

Obama had talked about the problems of nuclear proliferation in his Senate campaign and Lugar saw a potential bipartisan partner for the signature issue he'd previously worked on with Democratic Sen. Sam Nunn of Georgia.

Lugar invited Obama to join him on one of his regular fact-finding trips to Russia to oversee implementation of the Nunn–Lugar Cooperative Threat Reduction Program to secure and destroy weapons of mass destruction in the former Soviet Union.

More:Richard Lugar dies: A timeline of his life in Indiana and politics and on the world stage

More:Lugar calls Trump foreign policy 'simplistic, reactive'

"The first thing I learned is that when Dick Lugar travels overseas, it's not a junket," Obama said in 2012, when Lugar received the Defense Department's highest civilian award for his efforts. Obama described traipsing through nuclear weapons storage sites and land-mine junkyards, watching technicians with test tubes containing anthrax, and wondering why only the workers had on masks and gloves.

"I'm thinking, 'Wait a second. Why don't we have masks on?' " Obama said. "Dick Lugar is standing in the back of the room. I asked him, 'Have you seen it?' He says, 'Yes, Yes, I've seen it. I don't get too close now.' That's what it's like traveling with Dick Lugar."

Pictures of the two of them inspecting weapons stockpiles appeared in some of Obama's 2008 presidential campaign ads. Another TV ad showed a photo of them as the announcer said Obama had been a leader in the Senate on arms control. Obama also often named Lugar as the kind of Republican he would consider appointing to his administration.

Although Lugar stayed in the Senate after Obama moved to the White House, he worked closely with the Democratic administration on foreign policy issues. Lugar was instrumental, for example, in the Senate's approval in 2010 of an updated nuclear arms treaty with Russia that conservatives opposed.

In a thank-you call after Senate passage, Obama told Lugar that the Russia trip they'd taken together was a "direct line" to the treaty.

Two years later, as Lugar was seeking a seventh term, he faced criticism from fellow Republicans for being too willing to work with Democrats, including Obama.

When Obama awarded Lugar the Presidential Medal of Freedom in 2013, he thanked Lugar for having taking him under his wing as a young senator. And he praised Lugar for making the world safer and for being a pragmatic voice in a time of "unrelenting partisanship."

Obama echoed those comments in his statement Sunday, calling Lugar's death a "call to remember what a public servant can be."

"For thirty-six years," Obama said, "Richard Lugar proved that pragmatism and decency work – not only in Washington but all over the world. "