In the past, a victim’s family could force them to marry their rapist to avoid being shamed.
Rapists now stand to face up to 30 years in prison.
Somaliland declared itself independent from Somalia in 1991 but is not internationally recognised as a country. There is still no specific law against rape in Somalia, although it is punishable through a penal code that recognises some sexual offences.
Africa Live: Updates on this and other stories
Find out more about Somaliland
The bill has been agreed in the lower house of parliament and its speaker, Bashe Mohamed Farah, told the BBC that rape cases have risen and he hoped the new law would help stop that trend.
“Nowadays we have seen even people carrying out gang rapes,” he said.
“The main emphasis of the new act is to completely stop rape.”
The new law has come in after years of lobbying by children and women’s rights advocates.
Faisa Ali Yusuf of the Women’s Agenda Forum told the BBC they have been waiting for such legislation for a very long time.
The new bill still needs approval from the upper house and the BBC’s Anne Soy explains it comes within the context of the self-declared republic being keen to be seen internationally as a viable democracy with functioning institutions.
Correction 11 April 2018: This article has been amended to clarify that the bill had not yet passed into law and the length of prison sentence that those convicted may face.