DUBLIN, Ireland - Beaming before an exultant sea of people, President Obama on Monday reveled in his distant Irish ancestry, offering spirited thanks from tens of millions of Americans who trace connections to Ireland. Far away from divisive Washington politics, Obama stood with his wife, Michelle, and said: "We feel very much at home."

In a speech devoted as much to personal pride as to overt policy and politics, Obama told roughly 30,000 people gathered in central Dublin that he had come to reaffirm "the bonds of affection" between the United States and Ireland. "There's always been a little green behind the red, white, and blue," he said to cheers.

Obama's speech came after he had downed a pint of Guinness in tiny Moneygall, the Irish village of 300 where his great-great-great-grandfather once lived and worked as a shoemaker. It was an improbable and memorable pilgrimage for America's first black president into his Irish past, and Obama soaked it in.

"My name is Barack Obama, of the Moneygall Obamas," he said. The president sought to endear himself to the locals by speaking some phrases in Gaelic, including his campaign slogan of "Yes we can."

The president struck a more serious tone in his speech, marking the adversity of Ireland's history and current economic times, celebrating a country that shares a resilient success with America. He held up Ireland as a model for the world by describing its move from violent divisions to what he called a lasting peace on the island.

"Our greatest triumphs in America and Ireland alike are still to come," the president said. "And Ireland, if anyone ever says otherwise, if anybody ever tells you that your problems are too big, your challenges are too great . . . think about all that we've done together."

After the speech, the president walked the thronged Main Street of quaint Moneygall, where his ancestor on his Kansas-born mother's side, Falmouth Kearney, lived until leaving for the United States in 1850 at the height of Ireland's Great Famine. Obama's roots in the town were discovered during the 2008 presidential campaign.

Guinness last week delivered a specially brewed keg of stout to be poured the moment Obama walked through the door of Ollie's Bar. Obama downed his whole glass with gusto before the TV cameras.

The first couple spent extended time greeting Moneygall residents who had withstood soaking rain to see them. The thrilled villagers responded by waving American and Irish flags and breaking into periodic cries of "Obama! Obama!"

"Absolutely fabulous," said homemaker Ann McCormack, 39, after shaking Obama's hand. She said the town would be talking about this day forever. "We'll take it to our grave," she said.

The president told those invited in the pub that the Irish have had a powerful influence on American culture, and he spoke of the warmth and friendship between the peoples of Ireland and the United States. Obama spoke affectionately about his ancestral ties to country. And "with that," he declared with eagerness, it was time for a pint. Then it was back into the street for more handshakes.

Obama is on a six-day trip to work with allies on problems of war, peace, and economic growth. The volcanic cloud over Iceland forced the president to leave sooner Monday and land in Britain. On Tuesday, the Obamas will be feted at a dinner with Queen Elizabeth II.