SANAA, Yemen — Yemeni President Ali Abdullah Saleh has signed a deal to end his 33-year rule after almost 11 months of bloody conflict.

Saleh said his party welcomed a “real partnership” with the opposition, while Saudi Arabia hailed the signing as a “new page” in Yemen’s history.

The embattled president signed the initiative drafted by the Gulf Cooperation Council, a regional economic grouping, in Riyadh, Saudi Arabia, on Wednesday. Saleh had previously refused to sign on three separate occasions since the deal was first presented in April.

Change Square in Sanaa, Yemen’s capital, where anti-government protesters have been camped since February, erupted in celebration after hearing the news. The sound of fireworks and celebratory gunfire could be heard across the city.

Under the terms of the deal, Saleh will hand power to his vice president within 30 days and call for early elections within 90 days, holding a caretaker post until then.

More from GlobalPost: Yemen's protests hijacked

“For several months the GCC initiative has been the only way out of this conflict,” said Abdul Ghani Iryani, a Yemeni political analyst and president of the Democratic Awakening Movement. “But lets put things into perspective; signing is not everything, we have a long way to go and a lot of room for surprises.”

The deal also gives Saleh and his family immunity in exchange for the president stepping aside, something protesters have long called unacceptable.

Hundreds of thousands of Yemenis took to the streets in Sanaa and other major cities this week calling for the president to stand trial for the deaths of more than 800 protesters, at the hands of government security forces, since February.

Members of the opposition coalition, which is known as the Joint Meetings Party, or JMP, have also called for an international warrant for the president’s arrest, despite being at the table when the GCC deal was signed.

“The best thing the Yemenis can do is to arrest him and put him on trial,” said JMP spokesman Mohammed al-Qahtan at the end of October.

The president accepted the GCC plan just over a month after the United Nations condemned “the excessive use of force against peaceful protesters” in its so-called Resolution 2014.

Although the UN condemned the violence against unarmed protesters, stating “all those responsible for violence, human rights violations and abuses should be held accountable,” it urged Saleh to sign the Gulf deal.

More from GlobalPost: Drone attacks in Yemen fuel anger

According to the National Council, a group of opposition leaders acting as a government-in-waiting since August, more than 50 people have been killed — including six women and 11 children — and 2,000 injured since the UN resolution was issued on Oct. 21.

Inspired by the Arab Spring revolutions in Tunisia, Egypt and other Arab countries, millions of Yemenis have taken to the streets since February to call for an end to the current regime. Security forces have responded with a series of violent crackdowns, including shelling and the use of heavy weapons in residential areas, killing hundreds of protesters and injuring thousands.

The country has also been gripped by a simmering civil war. Ongoing violence, including shelling and gunfire, erupted again on Wednesday in several neighborhoods of Sanaa that have been the focal point of conflict between opposition tribes and government forces for months.

An attack on the presidential palace in June nearly killed Saleh, forcing him to go to Saudi Arabia for several months for treatment, leaving behind a power vacuum in a country that the United States believes to be a new front in the war against Al Qaeda-linked militants.

“Yemen still has a lot of problems and challenges ahead but I think the dynamic will change now and make an all-out civil war less likely,” said Iryani.

While the signing might lead to a temporary respite from the violence, the country remains volatile and few protesters or opposition groups trust that Saleh will follow though on the deal.

“We don’t want him to withdraw from any agreement — this must be final and there can be no backtracking,” said Houria Mash’Hur, a spokeswoman for the National Council.

More from GlobalPost: Yemen plagued by shortages

As the conflict has dragged on — after 11 months, it is the longest of the Arab revolutions — Yemenis have faced soaring unemployment, rising food costs, water shortages and debilitating power cuts.

The World Food Program ranks Yemen the 11th most food-insecure country in the world, with half of Yemeni children chronically malnourished. The United Nations has warned of a growing humanitarian crisis.

Blogger and activist NoonArabia, founder of an online “No to GCC deal” campaign, said the Yemeni people are unlikely to accept the plan.

“Yemenis in millions have marched on the streets rejecting the GCC deal and chanting ‘we want the world to pass a resolution, which defends the blood of the revolutionaries,’” she said. “They shouted: ‘There will be no immunity. Saleh and his cronies must face trial.’”