Shelling by Houthi rebels hit a women's prison in the country's southwestern province of Taiz, killing at least five prisoners, Yemeni officials have said.

The attack on Sunday also wounded two dozen prisoners, including four children staying with their jailed mothers, at the central prison in the government-held province, the officials said.

More:

Abdel Baset al-Bahar, deputy spokesman for Yemen's national army in Taiz, said the "Houthis targeted the central prison in Taiz with heavy artillery".

"This [attack] is criminal and dangerous," he said on his social media account.

Yemen's Prime Minister Maeen Abdulmalik Saeed said in a statement the attack on the prison was "evidence of the Houthis' aggression and massacres".

Mohamad al-Bukhaiti, a member of the Houthi's political bureau, told Al Jazeera by phone from Yemen's capital, Sanaa, that he "has no information about the attack at this point" and declined to comment.

The prison attack prompted Yemen President Abd-Rabbu Mansour Hadi to order the release of all prisoners held on minor charges during a phone call with Nabil Shamsan, the provincial governor, according to a statement issued by Shamsan's office.

War crime

Gamal Gasim, professor of political science at Grand Valley State University in Michigan, told Al Jazeera the shelling of the prison was a war crime.

"This is certainly a war crime and those who committed it should be brought to justice. An international investigation should be conducted to hold those who are responsible for it accountable."

Gasim also decried the "Houthis' disrespect for human rights" and the "targeting of women" who are the most vulnerable segment of Yemeni society.

'Dire humanitarian needs'

He said the international community was not serious about ending the fighting in Yemen, which has caused the world's worst humanitarian disaster. Gasim said both sides in the conflict were more concerned about their military goals than addressing the "dire humanitarian needs of the people of Yemen".

The prison attack came amid a drastic escalation in fighting between the internationally recognised government's forces and the Houthi rebels in recent weeks.

Violence in Yemen has displaced more than 40,000 people since January, adding to the estimated 3.6 million who fled their homes since the war began more than five years ago.

Yemen's civil war erupted late in 2014 when the Houthi rebels seized Sanaa along with much of the country's north.

The Houthi advance ousted Hadi's government.

A US-backed, Saudi-led military coalition of several Arab states intervened in early 2015 to try and restore Hadi's government.

The coalition has since dwindled and is now largely made up of forces aligned with Saudi Arabia and the United Arab Emirates, which have sought to remove the Houthis from power and restore the internationally recognised government.

Despite its military advantage in the air, the Saudi-led effort has failed to drive the Houthis from power.

The war has killed tens of thousands of people, many in Saudi-Emirati air strikes, and millions are suffering from food and medicine shortages as disease runs rampant.

Follow Ali Younes on Twitter: @ali_reports