In the past, a victim's family could force them to marry their rapist to avoid being shamed.
Rapists now stand to face at least 30 years in prison.
Somaliland declared itself independent from Somalia in 1991 but is not internationally recognised as a country. There is still no law against rape in Somalia.
Somaliland's speaker of parliament, 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 BBC's Anne Soy explains that the new law comes within the context of the self-declared republic being keen to be seen internationally as a viable democracy with functioning institutions.