* Azarov has been loyal lieutenant since Yanukovich elected
* Parliament votes to repeal anti-protest legislation
* Moves seen as concessions aimed at taking sting out of protests
* Ukraine in grip of street protests for two months
By Richard Balmforth and Pavel Polityuk
KIEV, Jan 28 (Reuters) - Ukrainian Prime Minister Mykola Azarov resigned on Tuesday while deputies loyal to President Viktor Yanukovich, acting to calm violent street protests, back-tracked and overturned anti-protest laws they rammed through parliament 12 days ago.
The first real concessions by Yanukovich since the crisis erupted two months ago brought cheers from several thousand demonstrators on Kiev's Independence Square, focal point of the protests. Opposition leaders said they would continue to harness street power to wring more gains.
"We have to change not only the government, but the rules of the game as well," declared boxer-turned-politician Vitaly Klitschko. "We are sure the struggle will continue," he said.
The 66-year-old Azarov tendered his resignation as parliament met for an emergency session to work out a deal that would satisfy the opposition and end protests in the capital Kiev and in other cities in which six people have been killed.
Yanukovich quickly accepted his resignation and that of his cabinet. First Deputy Prime Minister Serhiy Arbuzov will step in as acting prime minister and other ministers will stay on in caretaker roles until a cabinet is formed.
Azarov, a loyal lieutenant of Yanukovich since the president was elected in February 2010, said he was stepping down to help find a political compromise "for the sake of a peaceful settlement of the conflict".
A Russian-born hardliner who has referred to the protesters as "terrorists", Azarov was publicly humiliated by Yanukovich's offer at the weekend to give his job to former economy minister Arseny Yatsenyuk, another opposition leader, in an effort to stem the rising protests against his rule.
The opposition has been calling consistently for the resignation of the Azarov government since the crisis started. But Yatsenyuk and other opposition leaders rejected Yanukovich's offer of top government posts, seeing it as a trap intended to compromise them in front of their supporters on the streets.
The steward of the heavily-indebted economy through hard times and recession, Azarov backed the November decision to walk away from a free trade pact with the EU - the move which sparked the mass street protests. He took the heat in parliament, defending closer ties with Russia in a stormy debate.
REPEAL OF LAWS
Parliament went into emergency session on Tuesday with ministers loyal to Yanukovich saying they would press for a state of emergency to be declared if the opposition leaders did not rein in protesters and end occupation of municipal and government buildings across the country.
But then Yanukovich loyalists, clearly under pressure from the president and his aides to make a U-turn, voted to repeal anti-protest legislation they had pushed through on January 16.
It was these laws, banning virtually all form of public protest, which led to street violence between radical activists and police in which six people were killed.
Opposition leaders sought to keep up the pressure on Yanukovich, with Yatsenyuk calling on him to swiftly sign the repeal of the laws into force. Klitschko said opposition lawmakers would now press for amnesty for detained activists and a return to a 2004 constitution reducing the president's powers.
"These decisions which parliament has adopted are good but it's only a little progress. We won't leave here until the system and the constitution have been changed," said Ivan, 45, a protester from the Lviv region, who was at a barricade leading to Independence Square.
The crisis has revealed a sharp divide within Ukraine between those mainly from the Russian-speaking east who favour warmer ties with former Soviet master Moscow and those in the west who want better relations with the EU.
In turning away from Europe, Azarov's government had argued that improving ties with Russia was urgently needed to win a financial bailout. Moscow responded last month with an offer of $15 billion in loans and discounts on gas.
But the chaos could now put that lifeline in jeopardy. Ratings agency Standard & Poors cut Ukraine to CCC+ on Tuesday.
"The downgrade reflects our view that the significant escalation of the political turmoil in Ukraine makes the expected financial support package from Russia less certain should the government of President Yanukovych fall," it said.
In Brussels, President Vladimir Putin promised Russia would not cut off Ukraine if its government changed.
"Regarding your question whether we will review our agreements on loans and the energy sector if the opposition will take power ... No, we will not," Putin answered a reporter's question after three hours of talks with EU leaders.
The aid was to "support the people of Ukraine, not the government. It's the people, the common people that suffer."
Though the protest movement began because of Yanukovich's U-turn on policy towards Europe, it has since turned into a mass demonstration, punctuated by clashes with police, against perceived misrule and corruption under Yanukovich's leadership.
Several hundred people camp round-the-clock on Kiev's Independence Square and along an adjoining thoroughfare, while more radical protesters confront police lines at Dynamo football stadium some distance away.
A leader of 'Right Sector', a radical nationalist group involved in violent clashes with police, said members would stick to a truce which has held for several days as long as authorities adopt a conciliatory approach.
"If they (the authorities) make a move to compromise we will reduce our activities," Petro Yarush told reporters.
Talk of a state of emergency being declared in the former Soviet republic of 46 million made the European Union's foreign policy chief, Catherine Ashton, hastily bring forward a visit. She was due to arrive in Kiev on Tuesday night.