U.S. President Barack Obama said that Russian President Vladimir Putin must recognize and work with Ukraine's newly-elected government and stop "provocations" along its border, or face tougher sanctions from members of the Group of Seven nations.

All sides agreed Russia should change its behavior, and they joined in threatening to slap new sanctions that would target entire sectors of the Russian economy.

Obama: Russia Must Work With New Ukraine Leader

“We will have a chance to see what Mr. Putin does over the next two, three, four weeks, and if he remains on the current course, then we've already indicated the kinds of actions that we're prepared to take,” Obama said at a joint news conference with British Prime Minister David Cameron at the end of a G7 summit in Brussels, Belgium.

Obama: Russia Must Work With New Ukraine Leader

“Russia needs to seize that opportunity,” Obama said. “Russia needs to recognize that President-elect [Petro] Poroshenko is the legitimately elected leader of Ukraine and engage the government in Kyiv.”

Obama: Russia Must Work With New Ukraine Leader

Obama emerged from two days of meetings with the G7, saying it was a chance for the gathered leaders to make sure they are in “lockstep” on a strategy going forward in uncertain times in Ukraine.

He and Cameron both praised the united front that the U.S. and Europe has maintained in dealing with Russia and the crisis in Ukraine.

"What has been striking has been the degree of solidary between the United States and Europe in this crisis," Obama said. "I've been heartened by the steadfastness of Europe so far."

Obama said he understands the real economic consequences on countries that have extensive trade ties with Russia, but indicated those have to be weighed against the values and principles that Russia has violated.

“The choice is clear: Europeans have to stand up for those ideals and principles even if it creates some economic inconvenience," he said.

The president said the U.S. is looking at sanctions that would maximize the consequences on Russia but minimize the adverse effects on the economies of G7 nations.

Obama urged Putin to “enter into a dialogue” with Poroshenko, who is being inaugurated Saturday after winning the May 25 election.

Cameron, who will meet with Putin later Thursday, said he plans to tell the Russian president that Russia's actions in Ukraine are unacceptable and at odds with G7 leaders' democratic values.

The prime minister said he plans to discuss with Putin the demands outlined by the G7 members as a whole -- that Russia respect the results of Ukraine's presidential election, stop the flow of fighters and weapons to the eastern part of the country, and completely withdraw troops from its border with Ukraine

If Putin does not meet the demands, Russia, whose economy has already begun to suffer from present sanctions, will possibly face harsher, sectoral sanctions, Cameron said.

In other questions, Obama also said he had "expressed some concerns" to France about its sale of warships to Russia during this period.

“I think it would have been preferable to press the pause button," Obama said in response to a question about the decision to go ahead with the sale of French Mistral warships despite events in Ukraine.

France has come under pressure from some European allies to pull the plug on the 1.2-billion-euro deal on the grounds Russia could use the Mistral-class helicopter carriers to threaten its Black Sea neighbors.

France agreed to the sale under a 2011 contract, with the first vessel due in October and the second in 2015.

The Mistral, the second-largest ship in the French navy, is a high-seas military base that can transport up to 16 helicopters, four landing craft, 60 armed vehicles and some 700 troops.

In other G7 action, the world's leading industrialized nations vowed on Thursday to seal a series of free-trade deals that would radically change the shape of global commerce despite rising popular opposition.

Leaders of the G7 committed themselves to eight far-reaching accords that would encompass more than 80 percent of the world's economy but that effectively sideline China and Russia and have met with protests, particularly in Europe.

In the most ambitious round of liberalization since the demise of the Doha round of global trade talks, the leaders of Britain, France, Germany, Italy, Japan, Canada and the United States want to create a market of almost a billion people and set world trade rules that the rest may have to follow.

An EU-U.S. deal alone could generate $100 billion in additional economic output a year on both sides of the Atlantic.

The G7 also gave their backing on Thursday to a new global deal on climate change in 2015.