Mykola Azarov had offered to step down as prime minister to create “social and political compromise”.
The move came after the Ukrainian parliament voted overwhelmingly to annul a controversial anti-protest law.
The protests have spread in recent days across Ukraine, even to President Yanukovych’s stronghold in the east.
Official buildings in several cities have been occupied, and Tuesday saw the interior ministry report that protesters had stabbed and wounded three policemen in the southern city of Kherson, one of whom later died.
In total, at least five people have been killed in violence linked to the protests.
Mr Azarov was deeply unpopular with the opposition, who accused him of mismanaging the economy and failing to tackle corruption.
Their antipathy towards him grew after the protests started in November, when he described demonstrators as extremists and was also seen as being responsible for the use of force by police.
Parliament – holding an emergency debate on the crisis – voted by 361 to two to repeal the protest legislation, which among other measures banned the wearing of helmets by protesters and the blockading of public buildings.
The law had helped fuel the demonstrations which began in Independence Square in the capital, Kiev, after Mr Yanukovych pulled out of a planned trade deal with the European Union last November in favour of a $15bn (£9bn) bailout from Russia to bolster the ailing public finances.
MPs applauded in Ukraine’s parliament as the result of the annulment vote was announced.
Arseniy Yatsenyuk, a leading opposition lawmaker, said: “We have repealed all the laws against which the whole country rose up.”
Parliament adjourned after the vote on the protest law and discussions on the issue of granting an amnesty to convicted protesters proved inconclusive.
Mr Yanukovych had offered an amnesty only if protesters cleared barricades and stopped attacking government buildings.
In his resignation statement, Prime Minister Azarov said: “To create additional opportunities for social and political compromise and for a peaceful solution to the conflict, I made a personal decision to ask the president of Ukraine to accept my resignation as prime minister of Ukraine.”
The government had “done everything to ensure the peaceful resolution of the conflict” and would do “everything possible to prevent bloodshed, an escalation of violence and violation of citizens’ rights”, he said.
The BBC‘s David Stern, in Kiev, says that two weeks ago, Mr Azarov’s resignation would have been unthinkable.