Prime Minister Stephen Harper and President Barack Obama pledged a common approach to tackle climate change and the global recession during talks in Ottawa, but Obama said he did not press Canada to extend its mission in Afghanistan.

"As neighbours, we are so closely linked that sometimes we may have the tendency to take our relationship for granted," said Obama at a news conference Thursday afternoon.

"But the very success of our friendship throughout history demands that we renew and deepen our co-operation," he added.

Obama said that he hasn't asked Canada to extend its military mission in Afghanistan past the February 2011 deadline, contrary to speculation that he would use the visit to do so.

"I certainly did not press the prime minster," said Obama, following a working lunch and private meeting between the two leaders

"All I did was compliment Canada, not only on the troops that are there ... but also, the fact that Canada's largest foreign aid recipient is Afghanistan."

Obama praised the sacrifice of Canadian troops in the war-torn nation and added that the Ottawa visit -- his first foreign trip as president -- underscores the importance and closeness of Canada-U.S. relations.

"The people of Canada have an enormous burden that they have borne. Those in the United States are extremely thankful for the sacrifices that have been made," he said.

Obama plans to send 17,000 more U.S. troops to Afghanistan in the coming months to battle a stubborn Taliban insurgency. Currently, there are 36,000 U.S. troops stationed there.

But it wasn't all business during Obama's whirlwind, six-hour visit.

Obamamania reached a fever pitch in Ottawa when the president made an unscheduled stop at a local bakery to pick up some sweets and shake hands with a throng of star-struck fans.

Clean energy co-operation

Additionally, Harper said the two leaders have created a "clean-energy dialogue" which aims to eventually slash greenhouse gas emissions and combat climate change through a continental approach.

Harper said that the plan will commit "senior officials from both countries to collaborate on the development of clean energy science and technologies that will reduce greenhouse gases and combat climate change."

The new approach will be marked by greater co-operation and the sharing of technology and ideas, said Harper.

But the leaders said that implementing any new policies to reduce greenhouse gas emissions -- such as a cap-and-trade system -- is simply not realistic right now.

And Obama noted that Washington must first firm up its own environmental policies before it can forge any binding agreements with Ottawa.

"This dialogue will move us in the right direction," said Obama, who has made the environment a top priority in his administration.

"There are good, sound economic reasons for us to address this issue. On both sides of the border we can make our economies more energy-efficient."

Obama calms protectionist fears

Harper and Obama also stressed the importance of working in concert to kick-start the slumping world economy, despite fears in Canada and abroad that the deepening recession could lead to a renewal of protectionist policies in the U.S.

"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.

"We concur on the need for immediate concerted action to restore economic growth and to protect workers and families hit hardest by the recession."

In the weeks before Obama's visit, U.S. lawmakers debated the possibility of attaching a controversial "Buy American" policy to Washington's nearly $800-billion stimulus plan.

In turn, some Canadian union and political leaders said that Ottawa should implement a "Buy Canadian" policy to ensure that billions in government spending benefited Canadian jobs.

But Obama allayed those fears on Thursday and said that his administration won't pursue a go-it-alone approach.

"I provided Prime Minister Harper an assurance that I want to grow trade, not contract it," Obama said.

"I don't think that there was anything in the recovery package that is adverse to that goal."

A whirlwind, six-hour visit

Obama, travelling on Air Force One, touched down at Ottawa International Airport's Hangar 11 shortly before 10:30 a.m. ET., and was greeted on the tarmac by Gov. Gen. Michaelle Jean and Foreign Affairs Minister Lawrence Cannon.

Obama then held a brief meeting with Jean at the airport before his 50-car motorcade wound its way up to Parliament Hill.

Harper greeted Obama with a handshake in Parliament's Centre Block and the pair walked outside to smile and wave at the estimated 2,500-strong cheering crowd gathered on the front lawn.

Though Obama acknowledged his fans from behind a sheet of security glass, the chilled but lively crowd roared its approval.

While security in the city was tight, Obama surprised passersby when his motorcade pulled into Ottawa's quaint Byward Market to pick up a few souvenirs, including some cookies from the Le Moulin de Provence bakery.

Obama also reportedly asked his staff to pick up a "snow globe" from a local crafts store.

Hundreds of people flooded into the area to catch a glimpse of Obama, who took time to shake hands with some of the well-wishers.