(CNN) The Prime Minister of Armenia, Serzh Sargsyan, has stepped down following days of mass demonstrations in the streets of the capital Yerevan over what was seen as an unconstitutional power grab by the former president.

Sargsyan previously served two, five-year terms as president of the former Soviet Republic. First elected in 2008, he served as the country's head of state until he was appointed prime minister earlier this month.

Armenian policemen detain an opposition supporter during a rally in central Yerevan on April 21, 2018, held to protest former president Serzh Sargsyan's election as prime minister.

Over the weekend Nikol Pashinyan, an opposition MP and leader of the protests, was arrested but was released Monday shortly before the announcement.

"The situation has several solutions, but I will not take any of them. That is not mine. I am leaving office of the country's leader, of Prime Minister. The street movement is against my tenure. I am fulfilling your demand. Peace, harmony and reasoning for our country," he said.

Read More