(Adds quotes and details throughout)
By Mark Felsenthal
TOLUCA, Mexico, Feb 19 (Reuters) - U.S. President Barack Obama called on Ukraine's armed forces on Wednesday to stay out of the country's political crisis and warned that there would be consequences for those who "step over the line."
Using his toughest language so far in response to a Ukrainian conflict that has drawn threats of U.S. and European Union sanctions, Obama denounced the violence and put the onus on Ukraine's government to reach a peaceful resolution.
"We hold the Ukrainian government primarily responsible for making sure that it is dealing with peaceful protesters in an appropriate way, that the Ukrainian people are able to assemble and speak freely about their interests without fear of repression," Obama told reporters at the start of a North American summit in Mexico.
Obama and other Western leaders stepped up pressure on Ukraine's Russian-backed president, Viktor Yanukovich, after 26 people were killed in the country's worst violence since independence from the Soviet Union.
Shortly after Obama spoke, Yanukovich said he had agreed to a "truce" with opposition leaders and a start to negotiations to prevent further bloodshed. The crisis, complete with Cold War-style recriminations between Washington and Moscow, has centered on Independence Square in Kiev where riot police battled protesters on Tuesday.
Speaking to reporters ahead of a meeting with Mexican President Enrique Pena Nieto, Obama urged both sides in Ukraine to avoid violence but singled out the country's military for a specific warning against intervening in the crisis.
"We expect the Ukrainian government to show restraint," he said. "We've also said we expect peaceful protesters to remain peaceful, and we'll be monitoring very closely the situation, recognizing that with our European partners and the international community there will be consequences if people step over the line.
"And that includes making sure the Ukrainian military does not step into what should be a set of issues that can be resolved by civilians," he said.
Obama's rhetoric carried echoes of the "red line" he declared early on in Syria's three-year-old civil war against President Bashar al-Assad's use of chemical weapons, a warning he failed to enforce with military action last year.
Obama's admonition to Ukraine's military came after its defense ministry said the armed forces might take part in a countrywide anti-terrorist operation organized by the state security service. It had previously said that troops could only be used domestically if a state of emergency were declared.
The Pentagon on Wednesday also renewed warnings for Ukraine to keep its military away from anti-government protests.
"The Department of Defense is encouraged that the Ukrainian armed forces have not been brought into this crisis. We urge them to remain on the sidelines," said Pentagon spokesman Colonel Steve Warren.
While neither Obama nor the Pentagon gave any details on the possible repercussions, U.S. officials said on Wednesday they were consulting with EU officials on sanctions against those responsible for the violence in Ukraine.
"The scenes that we saw in Kiev yesterday were completely outrageous and have no place in the 21st century," White House Deputy National Security Adviser Ben Rhodes told reporters.
He said the United States would talk to European nations about the situation in Ukraine ahead of an EU foreign ministers meeting set for Brussels on Thursday to decide on sanctions.
The EU shifted course on Wednesday and moved to impose financial and travel restrictions on Ukrainian officials, even though diplomats have doubts about the effectiveness of sanctions.
Washington, which had complained earlier that the Europeans were not moving urgently enough on sanctions, was considering similar measures and expected broad congressional support, U.S. government and congressional sources said.
The Obama administration expects the number of people affected by sanctions to be "in the double digits" and to include high-ranking Ukrainian law enforcement officials "all the way up," a U.S. congressional source said.
If all EU member states agree - and diplomats indicate there will be strong support - the EU will target those deemed responsible for the violence, including members of Yanukovich's government, although not the president himself.
But the Obama administration was taking care not to jump out ahead of its EU allies.
The crisis erupted after Yanukovich spurned a broad trade deal with the European Union and accepted a $15 billion Russian bailout.
Rhodes said the United States would like to see Russia support efforts to reduce tensions in Ukraine, though there have been no signs of cooperation between the former Cold War foes to quell the crisis.
"I think the message we've delivered to the Russians is that, again, we are not in some competition for the future of Ukraine. Frankly, our interest is that the people of Ukraine are able to determine their future, not any external actor," he said. (Additional reporting by Eric Beech, Roberta Rampton, Patricia Zengerle, Matt Spetalnick, Phil Stewart; Writing by Matt Spetalnick; Editing by Alistair Bell and Douglas Royalty)