Richard Mourdock, who had lost four other political races before being elected as the state's treasurer, won the nomination after portraying Lugar as too moderate for Indiana. Mourdock will face Democratic U.S. Rep. Joe Donnelly in November.
While gracious in his concession speech, hours later Lugar's campaign released a statement slamming Mourdock's embrace of "groups whose prime mission is to cleanse the Republican Party of those who stray from orthodoxy as they see it."
"This is not conducive to problem solving and governance," Lugar said. "And he will find that unless he modifies his approach, he will achieve little as a legislator. Worse, he will help delay solutions that are totally beyond the capacity of partisan majorities to achieve."
Lugar's willingness to compromise and to broker deals — qualities that made him an effective statesman and senator for nearly 36 years — had become a liability among some Indiana Republicans, who have turned to a new, more socially conservative generation of leaders.
"Too often bipartisanship is equated with centrism or deal cutting," Lugar said in the statement from his campaign. "Bipartisanship is not the opposite of principle. One can be very conservative or very liberal and still have a bipartisan mindset."
The possibility of Lugar losing — let alone in a primary race — once seemed unthinkable. He had never drawn a primary challenge until Tuesday and was considered so politically untouchable six years ago that no Democrat even bothered to mount a challenge.
"I know what it's like to lose. It's not fun," Mourdock said Tuesday in an interview with The Associated Press. "And especially after he's given that 36 years in the Senate. I know he has to feel terrible tonight, and I truly feel badly for him."
Lugar said he wants Mourdock to succeed as a senator but said in the statement "that will require him to revise his stated goal of bringing more partisanship to Washington." His campaign didn't immediately return a call Tuesday from The Associated Press seeking elaboration on the statement.
Mourdock said he read the election results as a vote for his candidacy, not against Lugar's.
"He is not now my enemy," Mourdock said in his victory speech. "He will never be my enemy. He was simply over the last 15 months my opponent ... this race is not about animosity. It's about ideas."
As the leading Republican on the Senate Foreign Relations Committee, Lugar has long been considered one of the Congress' experts on foreign policy. He is a leading voice for a nuclear non-proliferation treaty with Russia and has often been mentioned as a potential Cabinet secretary. During a 2008 presidential debate, then-candidate Barack Obama suggested even he might consider the Indiana senator for a job in his administration.
That was too much for tea party Republicans and other conservatives who have shunned compromise with Obama and other Democrats.
After the election results were announced, Obama praised Lugar, saying he "served his constituents and his country well."
While Mourdock claimed the conservative credentials to better represent the state, his history as a candidate had been shaky. He lost three races for Congress between 1988 and 1992 and a race for secretary of state in 2002 and wasn't considered a rising star in GOP circles until lately. He was drafted by Gov. Mitch Daniels to fill the Republican Party's spot for state treasurer in 2006 and won re-election to the job in 2010.
Though Lugar entered the race heavily favored and much better funded than Mourdock, outside groups poured millions into the race, attacking Lugar on his record.
They also had a field day with a challenge over whether he was eligible to vote in the state, where he hadn't had a home since being elected to the Senate in 1977. Lugar, who hadn't faced questions about his residency in decades, suddenly found himself on the defensive over whether he lived in Indiana or northern Virginia.
Lugar tried to convince voters that he was more electable than Mourdock. He pointed to Senate races in 2010 where tea party candidates won the Republican nomination in Colorado, Delaware and Nevada but lost to Democrats in the general election, foiling opportunities for Republicans to pick up those seats.
His departure further depletes the ranks of moderates in the Senate. Republican Olympia Snowe of Maine and Democrats Kent Conrad of North Dakota and Jim Webb of Virginia have said they won't seek re-election, and several other moderates face tough races ahead.
Many voters said Tuesday that they backed Mourdock after supporting Lugar for years, citing criticisms that had never mattered before but that he struggled this time to shake, including questions over his age, connection to the state, use of attack ads and conservative credentials.
Lugar said Tuesday he can't do anything about his age, but he noted he still runs in charity road races and feels fit to serve another term. But the court fight over whether Lugar was even eligible to vote in the state convinced many voters that he'd lost touch with his Indiana roots.
Rob Dalton, a 52-year-old handyman from Indianapolis, said he had supported Lugar previously but voted for Mourdock because he felt Lugar had been in Washington too long.
"Lugar's been there too long, and I want a change," he said. "There's a lot of good old boy politics going on. We need new blood."
Obama carried Indiana in 2008, partly because of his ties to the populous northwestern part of the state neighboring his hometown of Chicago. Democrats acknowledge it will be difficult to win Indiana again this year. Still, the state could become more hospitable to Obama if the Democrats spend heavily to compete against Mourdock.
Lugar, who hadn't lost an election since his first Senate race in 1974, said he will not run as an independent in November.
"I have no regrets about running for re-election," Lugar said in conceding defeat Tuesday. "Even if doing so can be a very daunting task."
Associated Press writer Rick Callahan contributed to this story.