Cairo (CNN) -- Saudi Arabia recalled its ambassador to Egypt and closed its embassy in Cairo and its consulates in Alexandria and Suez Saturday, following protests in the Egyptian capital over a human rights lawyer imprisoned in the Arab kingdom.
The decision to pull out Saudi diplomats came after protester "attempts to storm and threaten the security and safety of its (embassy) employees," according to the Saudi Press Agency.
Throngs of Egyptians had gathered in front of the Saudi Embassy this week, calling for the release of Egyptian lawyer Ahmed el-Gezaw -- detained earlier this month for allegedly insulting King Abdullah.
Saudi officials say el-Gezawi was arrested for allegedly trying to smuggle thousands of pills into the country.
But the Egyptian Organization for Human Rights say el-Gezawi had been traveling on a pilgrimage to Mecca when he was detained.
The Cairo-based group credited the activist for demanding better treatment of Saudi-held Egyptian detainees and criticizing the kingdom over alleged human rights abuses.
El-Gezawi has since been sentenced to flogging and faces a year behind bars, the group reported.
Video of the demonstrations in Cairo was posted online earlier this week and showed sign-wielding crowds chanting slogans in front of the Saudi Embassy.
"Say it, don't be afraid, the Egyptian will be lashed," the crowd chanted. "We will lash the ambassador! Lash us imprison us! Tomorrow the revolution will be in Medina."
In a statement Saturday, the Egyptian government denounced "these irresponsible acts," saying that it regrets "the individual incidents, which were conducted by some citizens against the Embassy of the Kingdom of Saudi Arabia in Cairo."
"The incidents only reflect only the view of those who carried them out and nothing more," the statement said.
The protests and Saturday's decision by Saudi authorities to remove diplomatic personnel from the country appear to have again ratcheted up longstanding tensions between the two Middle Eastern nations.
"It's a relationship that's been flawed," said Steven Cook, senior fellow at the Council on Foreign Relations. "Especially since the uprising, many Egyptians regard Saudis as a counterrevolutionary force in the region."
Relations between the two countries soured in 1979 when the kingdom broke off diplomatic relations with Egypt after it inked a peace deal with Israel following the Camp David Accords. The ties were later restored in November 1987.
Egypt, the most populous Arab country, has often engaged in "a subtle competition" with their Saudi counterparts "over this question of regional leadership," Cook said.
Egypt erupted in protest last year during 18 days of demonstrations in Cairo's Tahrir Square after similar uprisings in neighboring Tunisia, ultimately ousting Egypt's longtime president Hosni Mubarak after nearly three decades in power.
"The Saudis were not enthusiastic about their uprising," Cook said of Egypt, pointing to apparent concerns among elites in the oil-rich kingdom over their own grip on power. "And they were angry at the United States for its role in supporting the movement."
In February 2011, President Barack Obama called for orderly transition in Egypt to a fully representative democracy, saying the transition "must be meaningful, it must be peaceful and it must begin now."
CNN's Mohamed Fadel Fahmy, Caroline Faraj and Salma Abdelaziz contributed to this report.