The friendship between American and Israel is "unbreakable," Democratic presidential candidate Barack Obama declared during a surprise appearance at the Israeli Embassy's celebration of the Jewish state's 60th birthday. Watch a video of Obama's speech. "I pledge to you that I will do whatever I can, in whatever capacity, to not only ensure Israel's security, but also to ensure that the people of Israel are able to thrive and prosper and build on the enormous promise that was made 60 years ago," he told the large audience of diplomats, politicians and Jewish community leaders. "I am absolutely convinced that our friendship between the two nations is unbreakable." In his brief remarks, Obama also touched on a visit he took to Israel in 2006. "It's a friendship rooted in shared interests, shared values, and the shared history among our people. It is supported by a strong and bipartisan consensus in this country that I have been proud to be a part of. And it will withstand any challenge to Israel - because America's commitment to Israel's security is unshakeable," he said. Obama was greeted by loud cheers, and once he left the stage people crowded around to snap pictures with cellphone cameras and to shake hands with leading candidate for the Democratic nomination. His welcome was markedly warmer than that given US Vice President Dick Cheney, who also spoke about the strong US-Israel relationship. When then-president Harry Truman recognized Israel just 11 minutes after the new state was announced, Cheney said, "a special bond was formed between our two countries - and that bond has only grown stronger and more meaningful over time." He also declared, to applause, that "Israel has never had a better friend in the White House than the 43rd president of the United States," George W. Bush. US Sen. Joseph Lieberman (I-Connecticut) also addressed the audience, while the speaker of the US House of Representatives, Nancy Pelosi, from California, circulated around the room. Obama took the stage as Hamas featured in a running argument between his campaign and that of John McCain, the presumptive Republican presidential nominee, who like Obama's Democratic competitor, Hillary Clinton, skipped the embassy reception as they were campaigning away from Washington. Obama and McCain have increasingly taken aim at each other as Clinton's path to the Democratic nomination has become steeper and steeper. After losing North Carolina in a blowout and pulling off only a narrow victory in Indiana last Tuesday, failing to close the gap in delegates and states won with only a handful of states left to vote, Obama's ascendancy has been seen as increasingly likely. On Thursday, he claimed that Republican John McCain was "losing his bearings" for repeatedly suggesting the Hamas terrorist group preferred Obama for president, an attacked that elicited an angry response from McCain's campaign, which accused him of trying to make an issue of McCain's age. Age is a touchy subject for McCain, who turns 72 in August and would be the oldest person to be sworn in as president if elected. At the root of the dispute is McCain's decision to call attention to a Hamas adviser's apparent affinity for Obama. The adviser, Ahmed Yousef, said in a recent interview: "We like Obama and hope that he will win the election." McCain used those comments in a fundraising appeal and has cited them in interviews. Asked about the matter Wednesday during a taping of The Daily Show with Jon Stewart, McCain said: "It's indicative of how some of our enemies view America. And I guarantee you, they're not going to endorse me." In an interview Thursday with CNN, Obama accused McCain of trying to smear him by repeating the comments. "This is offensive, and I think it's disappointing, because John McCain always says, 'Well, I'm not going to run that kind of politics,'" Obama said. "And then to engage in that kind of smear, I think, is unfortunate, particularly since my policy toward Hamas has been no different than his." "For him to toss out comments like that, I think, is an example of him losing his bearings as he pursues this nomination. We don't need name-calling in this debate," the Illinois senator added. Like McCain, Obama criticized former president Jimmy Carter for recently meeting with Hamas leaders, saying the US must not negotiate with a terrorist group that is intent on Israel's destruction. McCain had called on Obama to repudiate Carter's meeting. The McCain camp charge that Obama was trying to divert attention from a legitimate question by raising McCain's age. "He used the words 'losing his bearings' intentionally, a not-particularly-clever way of raising John McCain's age as an issue," McCain adviser Mark Salter said. "It is more than fair to raise this quote about Senator Obama, because it speaks to the policy implications of his judgment." Obama spokesman Bill Burton insisted that Obama was not trying to do what McCain's campaign accused him of. "Clearly, losing one's bearings has no relation to age," he said. AP contributed to this report.