UNION CITY, California (Reuters) - Republican John McCain took aim at presidential rival Barack Obama’s lack of military service on Thursday, drawing a rebuke from the Democratic front-runner for his “endless diatribes and schoolyard taunts.”

McCain’s opposition to Senate legislation that would expand educational benefits for military veterans ignited a heated crossfire between the two White House contenders as they gear up for November’s presidential election campaign.

McCain, a former Navy pilot and prisoner of war in Vietnam, reacted sharply after Obama criticized him for opposing the legislation. The Arizona senator did not return to the Senate to vote on the measure, which passed easily.

“I take a backseat to no one in my affection, respect and devotion to veterans,” McCain said. “And I will not accept from Senator Obama, who did not feel it was his responsibility to serve our country in uniform, any lectures on my regard for those who did.”

Obama, an Illinois senator who did not serve in the military, said he was proud to “give our veterans the support and opportunity they deserve” by voting for the bill. He said in a statement he was disappointed by McCain’s attack.

“These endless diatribes and schoolyard taunts from the McCain campaign do nothing to advance the debate about what matters to the American people,” Obama said.

The blistering exchange came as both candidates turn their attention to a likely match-up in November’s presidential election. McCain has clinched the Republican nomination, and Obama has moved within reach of the Democratic nomination.

Obama’s remaining rival, Sen. Hillary Clinton of New York, has promised to stay in the race despite his nearly unassailable lead in delegates who will select the Democratic nominee at the August convention.

The legislation that sparked the exchange was sponsored by Virginia Democratic Sen. James Webb and Nebraska Republican Sen. Chuck Hagel, both military veterans. McCain and the Bush administration said it was so generous it could encourage veterans to leave the military after one term to take advantage of the increased college benefits.

RESPECTS SERVICE

In his Senate speech, Obama said he respected McCain’s military service “but I can’t understand why he would line up behind the president in opposition.”

McCain, who has stepped up his criticism of Obama but had not previously mentioned his lack of military service, said Obama had no right to criticize him on the issue.

“It is typical, but no less offensive, that Senator Obama uses the Senate floor to take cheap shots at an opponent and easy advantage of an issue he has less than zero understanding of,” McCain said.

The exchange came as McCain campaigned in California, where he rejected the endorsement of a Texas preacher after the pastor was discovered to have made derogatory comments about Jews.

“Obviously, I find these remarks and others deeply offensive and indefensible, and I repudiate them,” McCain said of the remarks by John Hagee. “I did not know of them before Reverend Hagee’s endorsement, and I feel I must reject his endorsement as well.”

McCain’s statement came after The Huffington Post website reported on a late 1990s sermon Hagee gave in which he quoted from the Bible to make the argument that God’s will had its influence on Nazism.

“‘And they the hunters should hunt them,’ that will be the Jews. ‘From every mountain and from every hill and from out of the holes of the rocks.’ If that doesn’t describe what Hitler did in the Holocaust, you can’t see that,” Hagee had said.

Democratic presidential candidate Senator Barack Obama speaks at a town hall meeting at the B'Nai Tora Congregation in Boca Raton, Florida, May 22, 2008. REUTERS/Carlos Barria

McCain previously had distanced himself from Hagee, founder of Cornerstone Church of San Antonio, Texas, but still accepted his endorsement because of Hagee’s influence with evangelical Christians.

McCain, 71, plans to show a small group of reporters his medical records on Friday before he enjoys the Memorial Day holiday weekend at his Arizona vacation house with three potential vice presidential candidates -- Florida Gov. Charlie Crist, Louisiana Gov. Bobby Jindal and former Massachusetts Gov. Mitt Romney.

Obama also has begun thinking about his potential vice presidential choice, asking Jim Johnson, the former chief executive of government mortgage giant Fannie Mae, to begin the search, TheAtlantic.com reported.

Johnson performed a similar role for Democratic candidates John Kerry in 2004 and Walter Mondale in 1984.

McCain campaigned on Thursday in California’s Silicon Valley, attending an economic discussion with California Gov. Arnold Schwarzenegger and local business leaders.

(Additional reporting by Thomas Ferraro; writing by John Whitesides; editing by Cynthia Osterman)