OTTAWA - The world's most powerful man swept through the nation's capital Thursday on a whirlwind six-hour visit that was equal parts politics and star power.

U.S. President Barack Obama and his 50-car motorcade took over downtown, dazzling swooning well-wishers and making a mess for commuters.

It was a celebrity sideshow to the main event - a meeting with Prime Minister Stephen Harper that yielded agreement to work together to rescue the troubled economy, fight climate change and protect the auto industry.

The pair also discussed ways of promoting international peace and stability, particularly in Afghanistan. However, Obama said he did not ask Harper to extend Canada's combat role in the troubled country beyond its planned withdrawal date in February 2011.

"President Obama and I agree that Canada and the United States must work closely to counter the global economic recession by implementing mutually beneficial stimulus measures and by supporting efforts to strengthen the international financial system," Harper said.

The leaders announced the creation of a "clean-energy dialogue" among senior officials aimed at cutting greenhouse gases and combatting climate change. That dialogue is a precursor to the loftier goal of North America-wide greenhouse-gas targets, which would require extensive negotiations.

Obama has made the environment an integral part of his strategy to address the economic crisis and the two issues were at the top of the leaders' agenda.

Obama went out of his way to praise Canada, noting he has both Canadian in-laws and staff.

"I love this country," he said.

"I came to Canada on my first trip as president to underscore the closeness and the importance of the relationship between our two nations and to reaffirm the commitment of the United States to work with friends and partners to meet the common challenges of our time."

The American president was greeted on Parliament Hill by a small but adoring crowd of more than 1,000 supporters chanting "Yes We Can."

He emerged from his armoured presidential limousine and shook hands with Harper just inside Parliament's Centre Block.

The pair headed outside to wave to the crowd from behind security glass - drawing roars of approval - before heading back inside to a rotunda festooned with Canadian and American flags.

"Has someone mentioned I'm a southpaw and it always looks funny on TV," Obama quipped as he signed the visitors book.

The two leaders then headed upstairs to the prime minister's office for a brief, private meeting ahead of talks with officials on a slew of issues.

A few snow flakes swirled in the air as the smiling president, wearing an overcoat, glided down the stairs of the gangway. He was greeted by Gov. Gen. Michaelle Jean, several dignitaries and a row of Mounties in Stetsons and red serge.

The first black U.S. president enjoyed a relaxed chat with the first black Governor General, with Jean clapping a hand on Obama's back and throwing back her head in laughter as they strolled into the airport reception centre.

After a welcoming ceremony, Obama headed to Parliament Hill in his limousine, known as "The Beast" - a modified Cadillac with armour, bulletproof glass, a self-contained passenger compartment and sophisticated communications technology.

Overnight snow left the capital draped in white, while mild temperatures left roads and sidewalks wet and slushy.

Hundreds of people lined streets along the motorcade route, waving, cheering, and posing for pictures as Obama passed. A presidential wave from behind thick window glass was enough to send one group of teenage girls into a frenzy of screams and hugs.

On Parliament Hill, supporters cheered, chanted and sang Bob Marley's reggae classic "One Love" as they waited for a glimpse of their hero.

The only sign of protesters was a couple of small groups carrying a banners reading: "Climate Emergency" and "Stop Cigarette Smuggling From U.S. Into Canada."

One young man was arrested after apparently trying to hop a barricade.

Clary Fraser drove from Toronto to take in the moment. He said he was in Birmingham, Ala., during a tragic race bombing in 1963.

Change, he said, has come.

"No one, no one in the world would have dreamed, could suggest that there would one day be a black president of the United States," Fraser said.

"Obama don't look at colour. There is no black or white, no red or yellow. We're all one."

Vahid Saadati of Brampton, Ont., showed up with what he called the world's largest needlepoint - all five million stitches of it.

It took 650 volunteers two years to finish the piece, which says "Welcome" in 103 languages.

Beyond the relatively few stalwarts who braved the wet snow, there was little evidence of Obama mania.

Some shops did offer Obama T-shirts, Obama specialty coffee beans and even an Obama burger.

The BeaverTails hut in the Byward Market near Parliament Hill planned to offer a special Obama version of its fried-dough dessert. The Obama comes sprinkled with cinnamon, sugar and a chocolate "O."

But security details were still prepared for crowds.

Crews erected additional barricades around Parliament Hill in the early morning hours as security teams with police dogs, all-terrain vehicles and tactical units fanned out over the area in advance of the Obama visit. High above, sharp-shooters watched from the roof of the Parliament buildings.