|PIC1|His unexpected comments were welcomed by some Muslim groups, but the government was quick to distance itself from them, saying it was out of the question that the principles of sharia could be used in British civil courts.
Williams, speaking to the BBC, said other religions enjoyed tolerance of their laws in Britain and he called for a "constructive accommodation" with Muslim practice in areas such as marital disputes.
Asked if the adoption of sharia was necessary for community cohesion, Williams said: "It seems unavoidable.
"Certain conditions of sharia are already recognised in our society and under our law, so it is not as if we are bringing in an alien and rival system."
In response, Prime Minister Gordon Brown's office said: "There are instances where the government has made changes in regulations, for example to include sharia-compliant mortgage products, but in general terms, sharia law cannot be used as a justification for committing breaches of English law, nor can the principle of sharia law be used in a civilian court."
"The prime minister is clear that in Britain, British laws based on British values will apply," a spokesman said.
"There are specific instances that get looked at on a case-by-case basis," he added, but only if the change was consistent with British values.
The issue of integrating Britain's 1.8 million Muslims has been widely debated since July 2005, when four British Islamists carried out suicide bombings on London's transport network, killing 52 people.
Sharia is the body of Islamic religious law based on the Koran, the words and actions of the Prophet Mohammad and his companions, and rulings of Islamic scholars. It covers issues including worship, commercial dealings, marriage and penal laws.
It is implemented in varying degrees in Muslim countries.
Muslim groups welcomed Williams' intervention, calling it a bold move to understand Islam and the wishes of the community.
"Sharia law for civil matters is something which has been introduced in some western countries with much success," said Mohammed Shafiq, the head of the Ramadhan Foundation.
"I believe that Muslims would take huge comfort from the government allowing civil matters to be resolved according to their faith."
Williams said he was not endorsing the harsh punishments meted out in countries such as Saudi Arabia and Iran, where murderers and drug traffickers are publicly beheaded or hanged.
"Nobody in their right mind would want to see in this country the kind of inhumanity that has sometimes been associated with the practice of the law in some Islamic states, the extreme punishments, the attitudes to women," he said.
Any use of sharia in Britain should not take precedence over "the rights that are guaranteed to ... citizens in general".
Muslims should have a choice in legal disputes over marriage and financial matters, Williams said.
"There are ways of looking at marital dispute, for example, which provide an alternative to the divorce courts as we understand them. In some cultural and religious settings they would seem more appropriate."