Hizbul-Islam militants in Somalia ordered men in Mogadishu this week to grow their beards and trim their moustaches.
"Anyone found violating this law will face the consequences," a Hizbul-Islam militant said, announcing the edict.
But is growing a beard obligatory under Islam?
Professor Muhammad Abdel Haleem, of the School of Oriental and African Studies at the University of London, says "this is not the only view expressed by Muslim scholars."
Many Muslim scholars now do not see the beard as an obligation and do shave their beards.
Muslims learn about the Prophet's views on facial hair not from the Koran, but through hadith - or sayings - attributed to Muhammad.
One such hadith, in a collection by Muslim scholar Muhammad al-Bukhari centuries ago, stipulates: "Cut the moustaches short and leave the beard."
The Prophet Muhammad is believed to have had a beard and those who insist that devout Muslims grow beards argue that they are doing no more than asking the faithful to emulate the Prophet's actions.
The question that arises is one of enforcement.
Mr Abdel Haleem, along with many other Muslim scholars, says the wearing of beards should be considered a recommendation rather than an obligation.
The Taliban, who ruled Afghanistan until they were ousted in 2001, and the Islamists of Somalia, are among a small minority in the Muslim world who demand unconditional observance and threaten penalties for non-compliance.
Mr Abdel Haleem argues that all practising Muslims - of which he is one - should be free to exercise their choice over a matter about which there is no overall consensus of opinion, without fear of retribution.
Imam Dr Abduljalil Sajid - an Islamic scholar and one of the founders of the Muslim Council of Britain - based at the Brighton Islamic Mission in the UK, concurs.
"In my opinion, this is a bit like the issue of women wearing headscarves. It is not one of the compulsory pillars of Islam, like prayer or fasting."
There are, however, schools of Islamic law - Hanafi, Maliki, Hanbali and Shafi - which, among many other things, hold strong positions on beard length and the act of shaving.
Followers of Shia Islam generally prefer closely cropped beards, which are mostly "like two, or three days' growth".
Most Islamic scholars or other figures of religious authority, whether Shia or Sunni, sport beards in emulation of the Prophet.
However Egypt, Jordan and Turkey are an exception, says Imam Abduljalil. In these countries you would find some scholars without beards.
"Going without a beard became a sign of modernity," the imam explains. "In the 1960s and 1970s, you saw more Muslims shaving off their beards."
But for those who want to follow the sayings of the Prophet to the letter, the hadith, Imam Abduljalil says, offers guidelines on "how to trim your beard and keep it looking beautiful."
This article, which was originally published on 26 June, has been modified for clarification.