Swedish Foreign Minister Margot Wallstrom, who promoted Palestinian human rights and peace in Yemen during her five-year tenure, has announced that she will step down from her post to be with her family.

"The time has come for me to spend more time with my husband, my children and my grandchildren," Wallstrom wrote on Twitter on Friday.

"I have notified the Prime Minister of my wish to leave the government and my post as Minister for Foreign Affairs."

As Sweden's top diplomat, Wallstrom has been involved in several Middle East related files since taking office in 2014, and has spoken out most notably on Israeli and Saudi human rights abuses.

In October 2014, shortly after she took up her post in the foreign ministry, Sweden became the first European Union country to recognise Palestine as an independent state.

"It is an important step that confirms the Palestinians' right to self-determination. We hope that this will show the way for others," Wallstrom said at the time.

She also decried Israeli forces' deadly crackdown on Palestinian protesters in Gaza in May 2018, when dozens of Palestinians were killed in a single day.

"I would like to express my deep dismay, shock and sadness at the violence and the rising death toll among Palestinians protesting in Gaza, where Israeli forces have once again used live ammunition against civilians," she said in a statement at the time.

Wallstrom drew the ire of Israeli leaders in 2015 when she said after a deadly Islamic State (IS) group attack in Paris that the "desperate situation" of Palestinians under Israeli occupation contributes to the "radicalisation" of people around the world.

Wallstrom has also been critical of Saudi Arabia's human rights record, sparking a diplomatic row between the two countries that culminated in Stockholm's decision to scrap a major arms deal with Riyadh in March 2015.

Despite the crisis that ensued, Wallstrom stood by her criticism of Saudi Arabia and condemned the mistreatment of Saudi blogger Raif Badawi, who was sentenced to 1,000 lashes and 10 years in prison for criticising religion.

"I won't back down over my statements on women's rights, democracy and that one shouldn't flog bloggers," Wallstrom said in 2015. "I have nothing to be ashamed of."

The foreign minister also helped lead peace talks in Yemen, where Saudi Arabia and the United Arab Emirates are leading a military coalition against the country's Houthi rebels.

Last year, Sweden hosted United Nations-backed peace talks between the warring parties in Yemen.

The negotiations led to a prisoner exchange and an interim agreement over the Yemeni port city of Hodeidah.

Wallstrom's abrupt resignation on Friday comes only days after a trip to the Middle East, where she was working to revive Yemen peace talks.